> ## 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.

# Create a Message

The Messages API is the native chat interface for Anthropic Claude models. It accepts text and images and returns text. Built-in tools support file search, web search, and computer use. Function calling lets the model access external systems and data.

Send a basic Messages API request:

```bash curl theme={null}
curl --location --request POST 'https://geekai.co/api/v1/messages' \
--header 'Authorization: Bearer {YOUR_GEEKAI_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "claude-sonnet-4-20250514",
    "max_tokens": 1024,
    "messages": [
        {"role": "user", "content": "Hello"}
    ]
}'
```

```bash python theme={null}
# Install the Anthropic SDK first: `pip install anthropic`
import anthropic

client = anthropic.Anthropic(
    auth_token="$GEEKAI_API_KEY",
    base_url="https://geekai.co/api/v1"
)

message = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Hello"}
    ]
)
print(message.content)
```

```bash javascript theme={null}
# Install the Anthropic SDK first: `npm install @anthropic-ai/sdk`
import Anthropic from "@anthropic-ai/sdk";

const anthropic = new Anthropic({
    baseURL: "https://geekai.co/api/v1",
    authToken: "$GEEKAI_API_KEY"
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-4-20250514",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hello" }],
});
console.log(msg);
```

```bash go theme={null}
# Install the Go SDK first: `go get -u 'github.com/anthropics/anthropic-sdk-go@v1.6.2'`
package main

import (
	"context"
	"fmt"
	"github.com/anthropics/anthropic-sdk-go"
	"github.com/anthropics/anthropic-sdk-go/option"
)

func main() {
	client := anthropic.NewClient(
		option.WithBaseURL(baseURL),
		option.WithAuthToken(token),
	)
	message, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
		Model:     anthropic.F(anthropic.ModelClaudeSonnet4_0),
		MaxTokens: anthropic.F(int64(1024)),
		Messages: anthropic.F([]anthropic.MessageParam{
			anthropic.NewUserMessage(anthropic.NewTextBlock("Hello")),
		}),
        Stream: anthropic.F(false),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", message.Content)
}
```


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