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

# Claude-Sonnet-4-5-20250929-Thinking - Text To Text

> Claude-Sonnet-4-5-20250929-Thinking — Text To Text. GPTProto API reference.

Claude's official format for the text to text API.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://gptproto.com/v1/messages" \
    -H "Authorization: YOUR_API_KEY" \
    -H "anthropic-version: 2023-06-01" \
    -H "Content-Type: application/json" \
    -d '{
    "model": "claude-sonnet-4-5-20250929-thinking",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": "Who are you?"
      }
    ]
  }'
  ```

  ```python Python theme={null}
  import anthropic

  client = anthropic.Anthropic(
      api_key="YOUR_API_KEY",
      base_url="https://gptproto.com"
  )

  message = client.messages.create(
      model="claude-sonnet-4-5-20250929-thinking",
      max_tokens=1024,
      messages=[
          {"role": "user", "content": "Who are you?"}
      ]
  )

  print(message.content)
  ```

  ```javascript JavaScript theme={null}
  import Anthropic from '@anthropic-ai/sdk';

  const client = new Anthropic({
    apiKey: 'YOUR_API_KEY',
    baseURL: 'https://gptproto.com'
  });

  const message = await client.messages.create({
    model: 'claude-sonnet-4-5-20250929-thinking',
    max_tokens: 1024,
    messages: [
      { role: 'user', content: 'Who are you?' }
    ]
  });

  console.log(message.content);
  ```

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

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

  func main() {
      url := "https://gptproto.com/v1/messages"

      payload := []byte(`{
    "model": "claude-sonnet-4-5-20250929-thinking",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": "Who are you?"
      }
    ]
  }`)

      req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload))
      req.Header.Set("Authorization", "YOUR_API_KEY")
      req.Header.Set("anthropic-version", "2023-06-01")
      req.Header.Set("Content-Type", "application/json")

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

      body, _ := ioutil.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```
</CodeGroup>

<CodeGroup>
  ```json 401 - Invalid API Key theme={null}
  {
    "error": {
      "type": "authentication_error",
      "message": "Invalid API key"
    }
  }
  ```

  ```json 400 - Invalid Request theme={null}
  {
    "error": {
      "type": "invalid_request_error",
      "message": "messages: field required"
    }
  }
  ```

  ```json 429 - Rate Limit Exceeded theme={null}
  {
    "error": {
      "type": "rate_limit_error",
      "message": "Rate limit exceeded"
    }
  }
  ```

  ```json 500 - Internal Server Error theme={null}
  {
    "error": {
      "type": "api_error",
      "message": "Internal server error"
    }
  }
  ```

  ```json 529 - Overloaded theme={null}
  {
    "error": {
      "type": "overloaded_error",
      "message": "Service is temporarily overloaded"
    }
  }
  ```
</CodeGroup>

## Parameters

| Parameter        | Type    | Required | Default                                         | Description                                                                                                   |
| ---------------- | ------- | -------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `model`          | string  | ✅ Yes    | `claude-sonnet-4-5-20250929-thinking`           | The model to use for the request                                                                              |
| `messages`       | array   | ✅ Yes    | `[{'role': 'user', 'content': 'Who are you?'}]` | Array of message objects for the conversation. Each message must have a role (user or assistant) and content. |
| `max_tokens`     | integer | ✅ Yes    | `1024`                                          | The maximum number of tokens to generate before stopping                                                      |
| `temperature`    | number  | ❌ No     | `1.0`                                           | Amount of randomness injected into the response. Ranges from 0.0 to 1.0                                       |
| `top_p`          | number  | ❌ No     | `1.0`                                           | Use nucleus sampling. Ranges from 0.0 to 1.0                                                                  |
| `top_k`          | integer | ❌ No     | `null`                                          | Only sample from the top K options for each subsequent token                                                  |
| `stream`         | boolean | ❌ No     | `false`                                         | Whether to incrementally stream the response using server-sent events                                         |
| `stop_sequences` | array   | ❌ No     | -                                               | Custom text sequences that will cause the model to stop generating                                            |

### Messages Array Structure

Each message object in the `messages` array should have the following structure:

| Field     | Type         | Required | Description                                                       |
| --------- | ------------ | -------- | ----------------------------------------------------------------- |
| `role`    | string       | ✅ Yes    | The role of the message. Can be: `user`, `assistant`, or `system` |
| `content` | array/string | ✅ Yes    | The content of the message                                        |

### Content Array Structure (when content is an array)

| Field  | Type   | Required | Example                                     | Description                          |
| ------ | ------ | -------- | ------------------------------------------- | ------------------------------------ |
| `type` | string | ✅ Yes    | `text`                                      | The type of content                  |
| `text` | string | ✅ Yes    | `"The positive prompt for the generation."` | The text content when type is `text` |
