> ## 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-Opus-4-6-Thinking - File Analysis

> Supreme reasoning in claude opus 4.6 thinking file analysis. Exceptional handling of complex logic, technical data, and massive documentation.

## Authentication

1. Sign up for a GPTProto account at [https://gptproto.com](https://gptproto.com)
2. Navigate to the API Keys section in your dashboard
3. Generate a new API key (sk-xxxxx)
4. Copy and securely store your API key
   For authentication details, please refer to the [Authentication](https://docs.gptproto.com/authentication) section.

## Initiate Request

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://gptproto.com/v1/messages' \
  --header 'Authorization: GPTPROTO_API_KEY' \
  --header 'Content-Type: application/json' \
  --header 'anthropic-version: 2023-06-01' \
  --data '{
    "model": "claude-opus-4-6-thinking",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Please analyze this PDF document and provide a summary of its content"
          },
          {
            "type": "document",
            "source": {
              "type": "url",
              "url": "https://tos.gptproto.com/resource/gptproto.pdf"
            }
          }
        ]
      }
    ]
  }'

  ```

  ```javascript JavaScript theme={null}
  const axios = require('axios');
  let data = JSON.stringify({
    "model": "claude-opus-4-6-thinking",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Please analyze this PDF document and provide a summary of its content"
          },
          {
            "type": "document",
            "source": {
              "type": "url",
              "url": "https://tos.gptproto.com/resource/gptproto.pdf"
            }
          }
        ]
      }
    ]
  });

  let config = {
    method: 'post',
    maxBodyLength: Infinity,
    url: 'https://gptproto.com/v1/messages',
    headers: { 
      'Authorization': 'GPTPROTO_API_KEY', 
      'Content-Type': 'application/json', 
      'anthropic-version': '2023-06-01'
    },
    data : data
  };

  axios.request(config)
  .then((response) => {
    console.log(JSON.stringify(response.data));
  })
  .catch((error) => {
    console.log(error);
  });


  ```

  ```python Python theme={null}
  import requests
  import json

  url = "https://gptproto.com/v1/messages"

  payload = json.dumps({
    "model": "claude-opus-4-6-thinking",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Please analyze this PDF document and provide a summary of its content"
          },
          {
            "type": "document",
            "source": {
              "type": "url",
              "url": "https://tos.gptproto.com/resource/gptproto.pdf"
            }
          }
        ]
      }
    ]
  })
  headers = {
    'Authorization': 'GPTPROTO_API_KEY',
    'Content-Type': 'application/json',
    'anthropic-version': '2023-06-01'
  }

  response = requests.request("POST", url, headers=headers, data=payload)

  print(response.text)


  ```

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

  import (
    "fmt"
    "strings"
    "net/http"
    "io"
  )

  func main() {

    url := "https://gptproto.com/v1/messages"
    method := "POST"

    payload := strings.NewReader(`{
    "model": "claude-opus-4-6-thinking",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Please analyze this PDF document and provide a summary of its content"
          },
          {
            "type": "document",
            "source": {
              "type": "url",
              "url": "https://tos.gptproto.com/resource/gptproto.pdf"
            }
          }
        ]
      }
    ]
  }`)

    client := &http.Client {
    }
    req, err := http.NewRequest(method, url, payload)

    if err != nil {
      fmt.Println(err)
      return
    }
    req.Header.Add("Authorization", "GPTPROTO_API_KEY")
    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("anthropic-version", "2023-06-01")

    res, err := client.Do(req)
    if err != nil {
      fmt.Println(err)
      return
    }
    defer res.Body.Close()

    body, err := io.ReadAll(res.Body)
    if err != nil {
      fmt.Println(err)
      return
    }
    fmt.Println(string(body))
  }

  ```
</CodeGroup>

<Accordion title="Response Example">
  ```json theme={null}
  {
      "id": "msg_abcd",
      "type": "message",
      "role": "assistant",
      "model": "<model>",
      "content": [
          {
              "type": "text",
              "text": "I'm Claude, an AI assistant made by Anthropic. I'm designed to be helpful, harmless, and honest. I can help with a wide range of tasks like answering questions, writing, analysis, brainstorming, coding, and more.\n\nIs there something I can help you with?"
          }
      ],
      "stop_reason": "end_turn",
      "usage": {
          "input_tokens": 11,
          "cache_creation_input_tokens": 0,
          "cache_read_input_tokens": 0,
          "output_tokens": 67,
          "cache_creation": {},
          "claude_cache_creation_5_m_tokens": 0,
          "claude_cache_creation_1_h_tokens": 0
      }
  }
  ```
</Accordion>

## Parameters

| Parameter        | Type    | Required | Default           | Range              | Description                                                                                                                                                                                    |
| ---------------- | ------- | -------- | ----------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `model`          | string  | ✅ Yes    | `claude-opus-4-6` | -                  | The model identifier. Use `claude-opus-4-6` for this model                                                                                                                                     |
| `messages`       | array   | ✅ Yes    | -                 | -                  | Input messages for the conversation. Each message must have a `role` (user/assistant) and `content` (string or array of content blocks)                                                        |
| `max_tokens`     | integer | ✅ Yes    | -                 | 1-64000            | Maximum number of tokens to generate. The model may stop before reaching this limit                                                                                                            |
| `tools`          | array   | ✅ Yes    | -                 | -                  | Array of tool objects. For web search, must include the web\_search tool configuration with type `web_search_20250305`                                                                         |
| `temperature`    | number  | ❌ No     | `1.0`             | 0.0-1.0            | Controls randomness in output. Use lower values (closer to 0.0) for analytical tasks, higher values (closer to 1.0) for creative tasks. Note: Even at 0.0, results are not fully deterministic |
| `top_p`          | number  | ❌ No     | -                 | 0.0-1.0            | Nucleus sampling threshold. Controls diversity by considering only tokens with cumulative probability up to top\_p. Recommended for advanced use only. Do not use with temperature             |
| `top_k`          | integer | ❌ No     | -                 | >0                 | Only sample from the top K options for each token. Removes low probability responses. Recommended for advanced use only                                                                        |
| `stream`         | boolean | ❌ No     | `false`           | -                  | Whether to stream the response incrementally using server-sent events                                                                                                                          |
| `stop_sequences` | array   | ❌ No     | -                 | Max 8191 sequences | Custom text sequences that will cause the model to stop generating. Each sequence must contain non-whitespace characters                                                                       |

### Messages Array Structure

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

| Field     | Type         | Required | Range | Description                                                                                                                     |
| --------- | ------------ | -------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- |
| `role`    | string       | ✅ Yes    | -     | The role of the message. Can be: `user` or `assistant`                                                                          |
| `content` | string/array | ✅ Yes    | -     | The content of the message. Can be a simple string for text-only messages, or an array of content blocks for multimodal content |

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

| Field  | Type   | Required | Range | Description      |
| ------ | ------ | -------- | ----- | ---------------- |
| `type` | string | ✅ Yes    | -     | Must be `text`   |
| `text` | string | ✅ Yes    | -     | The text content |

### Tools Array Structure

For web search functionality, the `tools` array should contain a web search tool object:

| Field             | Type    | Required | Range | Description                                                                            |
| ----------------- | ------- | -------- | ----- | -------------------------------------------------------------------------------------- |
| `type`            | string  | ✅ Yes    | -     | The type of tool. Must be `web_search_20250305` for web search                         |
| `name`            | string  | ✅ Yes    | -     | The name of the tool. Use `web_search`                                                 |
| `max_uses`        | integer | ❌ No     | 1-10  | Maximum number of times the web search tool can be used in a single request            |
| `allowed_domains` | array   | ❌ No     | -     | Only include search results from these domains. Cannot be used with `blocked_domains`  |
| `blocked_domains` | array   | ❌ No     | -     | Never include search results from these domains. Cannot be used with `allowed_domains` |
| `user_location`   | object  | ❌ No     | -     | Localize search results based on user's location                                       |

#### Max Uses

The `max_uses` parameter limits the number of searches performed. If Claude attempts more searches than allowed, the `web_search_tool_result` will be an error with the `max_uses_exceeded` error code.

#### Domain Filtering

When using domain filters:

* Domains should not include the HTTP/HTTPS scheme (use `example.com` instead of `https://example.com`)
* Subdomains are automatically included (`example.com` covers `docs.example.com`)
* Specific subdomains restrict results to only that subdomain (`docs.example.com` returns only results from that subdomain, not from `example.com` or `api.example.com`)
* Subpaths are supported (`example.com/blog`)
* You can use either `allowed_domains` or `blocked_domains`, but not both in the same request
* Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console

#### User Location Structure

The `user_location` object allows you to localize search results based on a user's location:

| Field      | Type   | Required | Range | Description                                        |
| ---------- | ------ | -------- | ----- | -------------------------------------------------- |
| `type`     | string | ✅ Yes    | -     | The type of location. Must be `approximate`        |
| `city`     | string | ✅ Yes    | -     | The city name (e.g., `San Francisco`)              |
| `region`   | string | ✅ Yes    | -     | The region or state (e.g., `California`)           |
| `country`  | string | ✅ Yes    | -     | The country code (e.g., `US`)                      |
| `timezone` | string | ✅ Yes    | -     | The IANA timezone ID (e.g., `America/Los_Angeles`) |

#### Complete Tool Configuration Example

```json theme={null}
{
  "type": "web_search_20250305",
  "name": "web_search",
  "max_uses": 5,
  "allowed_domains": ["example.com", "trusteddomain.org"],
  "user_location": {
    "type": "approximate",
    "city": "San Francisco",
    "region": "California",
    "country": "US",
    "timezone": "America/Los_Angeles"
  }
}
```

## Error Codes

### Common Error Codes

| Error Code | Error Name               | Description                                                                                                       |
| ---------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- |
| 401        | Unauthorized             | API key is missing or invalid                                                                                     |
| 403        | Forbidden                | Your API key doesn't have permission to access this resource, or insufficient balance for the requested operation |
| 429        | Too Many Requests        | You've exceeded your rate limit                                                                                   |
| 500        | Internal server error    | An internal server error occurred                                                                                 |
| 503        | Content policy violation | Content blocked due to safety concerns (actual status code is 400)                                                |
