> ## Documentation Index
> Fetch the complete documentation index at: https://docs.geekai.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Basic Chat

### Model parameters

* Model ID: Follow [Choose a Model](https://docs.geekai.co/en/docs/chat/model.md) to copy the ID into the `model` field.
* Model parameters: See the [Chat API reference](https://docs.geekai.co/en/api/chat/completions.md).
* Endpoint: `https://geekai.co/api/v1/chat/completions` (use `geekai.dev` for international access).
* API key: [Get an API key](https://docs.geekai.co/en/docs/quick_start.md).

### Example requests

Send a basic chat request:

```bash curl theme={null}
curl --location --request POST 'https://geekai.co/api/v1/chat/completions' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gpt-6.1-sol",
    "messages": [
        {
            "role": "user",
            "content": "Hello"
        }
    ]
}'
```

```bash python theme={null}
# Install the OpenAI SDK first: `pip3 install openai`

from openai import OpenAI

client = OpenAI(api_key="$GEEKAI_API_KEY", base_url="https://geekai.co/api/v1")

response = client.chat.completions.create(
    model="gpt-6.1-sol",
    messages=[
        {"role": "user", "content": "Hello"},
    ],
    stream=False
)

print(response.choices[0].message.content)
```

```bash javascript theme={null}
// Install the OpenAI SDK first: `npm install openai`

import OpenAI from "openai";

const openai = new OpenAI({
    baseURL: 'https://geekai.co/api/v1',
    apiKey: '$GEEKAI_API_KEY'
});

async function main() {
    const completion = await openai.chat.completions.create({
        messages: [{ role: "user", content: "Hello" }],
        model: "gpt-6.1-sol",
    });

    console.log(completion.choices[0].message.content);
}

main();
```

```bash go theme={null}
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
)

func main() {
	requestBody := map[string]interface{}{
		"model": "gpt-6.1-sol",
		"messages": []interface{}{
            map[string]interface{}{
                "role": "user",
                "content": "Hello",
            },
        }
	}

	jsonData, err := json.Marshal(requestBody)
	if err != nil {
		panic(err)
	}

	client := &http.Client{}
	req, err := http.NewRequest("POST", "https://geekai.co/api/v1/chat/completions", bytes.NewBuffer(jsonData))
	if err != nil {
		panic(err)
	}

	req.Header.Set("Authorization", "Bearer $GEEKAI_API_KEY")
	req.Header.Set("Content-Type", "application/json")

	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		panic(err)
	}

	fmt.Println(string(body))
}
```

This basic example works with all chat models.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.