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

# GPT-5.1-Codex-Max - Image To Text - Response

> Elite gpt 5.1 codex max image to text. Unrivaled analysis of complex technical visuals and industrial diagrams.

## 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/responses' \
  --header 'Authorization: GPTPROTO_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-5.1-codex-max",
    "input": [
      {
        "role": "user",
        "content": [
          {
            "type": "input_text",
            "text": "What is in this image?"
          },
          {
            "type": "input_image",
            "image_url": "https://tos.gptproto.com/resource/cat.png"
          }
        ]
      }
    ]
  }'

  ```

  ```javascript JavaScript theme={null}
  const axios = require('axios');
  let data = JSON.stringify({
    "model": "gpt-5.1-codex-max",
    "input": [
      {
        "role": "user",
        "content": [
          {
            "type": "input_text",
            "text": "What is in this image?"
          },
          {
            "type": "input_image",
            "image_url": "https://tos.gptproto.com/resource/cat.png"
          }
        ]
      }
    ]
  });

  let config = {
    method: 'post',
    maxBodyLength: Infinity,
    url: 'https://gptproto.com/v1/responses',
    headers: { 
      'Authorization': 'GPTPROTO_API_KEY', 
      'Content-Type': 'application/json'
    },
    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/responses"

  payload = json.dumps({
    "model": "gpt-5.1-codex-max",
    "input": [
      {
        "role": "user",
        "content": [
          {
            "type": "input_text",
            "text": "What is in this image?"
          },
          {
            "type": "input_image",
            "image_url": "https://tos.gptproto.com/resource/cat.png"
          }
        ]
      }
    ]
  })
  headers = {
    'Authorization': 'GPTPROTO_API_KEY',
    'Content-Type': 'application/json'
  }

  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/responses"
    method := "POST"

    payload := strings.NewReader(`{
    "model": "gpt-5.1-codex-max",
    "input": [
      {
        "role": "user",
        "content": [
          {
            "type": "input_text",
            "text": "What is in this image?"
          },
          {
            "type": "input_image",
            "image_url": "https://tos.gptproto.com/resource/cat.png"
          }
        ]
      }
    ]
  }`)

    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")

    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>

## Parameters

### Core Parameters

| Parameter        | Type         | Required | Default | Range                                                  | Description                                                                                                                                                                                  |
| ---------------- | ------------ | -------- | ------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `model`          | string       | ✅ Yes    | -       | -                                                      | Model ID used to generate the response, like `gpt-4o` or `o3`.                                                                                                                               |
| `input`          | string/array | ✅ Yes    | -       | -                                                      | Input content for the model.                                                                                                                                                                 |
| `>input.role`    | string       | ✅ Yes    | -       | `user`<br />`assistant`<br />`system`<br />`developer` | The role of the message input. One of user, assistant, system, or developer.                                                                                                                 |
| `>input.content` | string/array | ✅ Yes    | -       | -                                                      | A text input to the model when string; a list of one or many input items to the model, containing different content types when array. See [Multimodal Input](#multimodal-input) for details. |

### Advanced Parameters

| Parameter            | Type    | Required | Default  | Range                                                                   | Description                                                                                                                                                                                                                                                   |
| -------------------- | ------- | -------- | -------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `stream`             | boolean | ❌ No     | `false`  | `true`<br />`false`                                                     | Whether to stream the response back incrementally. Defaults to false.                                                                                                                                                                                         |
| `max_output_tokens`  | integer | ❌ No     | -        | -                                                                       | An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.                                                                                                                           |
| `reasoning`          | object  | ❌ No     | -        | -                                                                       | Configuration options for reasoning models (gpt-5 and o-series models only).                                                                                                                                                                                  |
| `>reasoning.effort`  | string  | ❌ No     | `medium` | `none`<br />`minimal`<br />`low`<br />`medium`<br />`high`<br />`xhigh` | Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning. See [Model-Specific Reasoning Configurations](#model-specific-reasoning-effort-configurations) for details. |
| `>reasoning.summary` | string  | ❌ No     | -        | `auto`<br />`concise`<br />`detailed`                                   | A summary of the reasoning performed by the model. Useful for debugging and understanding the model's reasoning process.                                                                                                                                      |
| `tools`              | array   | ❌ No     | -        | -                                                                       | A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. See [Tools Parameters](#tools-parameters) for details.                                 |

### Multimodal Input

<CodeGroup>
  ```json Input text theme={null}
  {
    "role": "user",
    "content": [
      {
        "type": "input_text",
        "text": "Who are you?"
      }
    ]
  }
  ```

  ```json Input image theme={null}
  {
    "role": "user",
    "content": [
      {
        "type": "input_image",
        "image_url": "https://example.com/image.jpg"
      }
    ]
  }
  ```

  ```json Input file theme={null}
  {
    "role": "user",
    "content": [
      {
        "type": "input_file",
        "filename": "file.pdf",
        "file_url": "https://example.com/file.pdf"
      }
    ]
  }
  ```
</CodeGroup>

| parameter           | Type   | Required | Default | Range / Example                                   | Description                                                                                                                                              |
| ------------------- | ------ | -------- | ------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `content.type`      | string | ✅ Yes    | —       | `input_text`<br />`input_image`<br />`input_file` | Identifies the content block type for multimodal input.                                                                                                  |
| `content.text`      | string | ❌ No     | —       | -                                                 | The text input to the model.                                                                                                                             |
| `content.file_id`   | string | ❌ No     | -       | -                                                 | The ID of the file to be sent to the model.                                                                                                              |
| `content.detail`    | string | ❌ No     | `auto`  | `high`<br />`low`<br />`auto`                     | The detail level of the image to be sent to the model. One of high, low, or auto. Defaults to auto. <br />Only required when `type=input_image`.         |
| `content.image_url` | string | ❌ No     | -       | -                                                 | The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.  <br />Only required when `type=input_image`. |
| `content.file_url`  | string | ❌ No     | -       | -                                                 | The URL of the file to be sent to the model. <br />Only required when `type=input_file`.                                                                 |
| `content.file_data` | string | ❌ No     | -       | -                                                 | The content of the file to be sent to the model. <br />Only required when `type=input_file`.                                                             |
| `content.filename`  | string | ❌ No     | -       | -                                                 | The name of the file to be sent to the model. <br />Only required when `type=input_file`.                                                                |

### Tools Parameters

<CodeGroup>
  ```json Web search  theme={null}
  {
    "tools": [
      {
          "type": "web_search",
          "filters": {
          "allowed_domains": ["example.com"]
          },
          "search_context_size": "low",
          "user_location":{
              "city": "San Francisco",
              "country": "US",
              "region": "California",
              "timezone": "America/Los_Angeles",
              "type": "approximate"
          }
      }
    ]
  }
  ```
</CodeGroup>

| parameter                   | Type   | Required | Default       | Range / Example                           | Description                                                                                                                                   |
| --------------------------- | ------ | -------- | ------------- | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`                      | string | ✅ Yes    | —             | `web_search`<br />`web_search_2025_08_26` | The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.                                                              |
| `filters`                   | object | ❌ No     | -             | -                                         | Filters for the search.                                                                                                                       |
| `>filters.allowed_domains`  | string | ❌ No     | -             | `["pubmed.ncbi.nlm.nih.gov"]`             | Allowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.             |
| `tools.search_context_size` | string | ❌ No     | `medium`      | `low`<br />`medium`<br />`high`           | High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. |
| `user_location`             | object | ❌ No     | -             | -                                         | The approximate location of the user.                                                                                                         |
| `>user_location.city`       | string | ❌ No     | -             | -                                         | Free text input for the city of the user, e.g. San Francisco.                                                                                 |
| `>user_location.country`    | string | ❌ No     | -             | -                                         | The two-letter ISO country code of the user, e.g. US.                                                                                         |
| `>user_location.region`     | string | ❌ No     | -             | -                                         | Free text input for the region of the user, e.g. California.                                                                                  |
| `>user_location.timezone`   | string | ❌ No     | -             | -                                         | The IANA timezone of the user, e.g. America/Los\_Angeles.                                                                                     |
| `>user_location.type`       | string | ❌ No     | `approximate` | -                                         | The type of location approximation. Always approximate.                                                                                       |

## Model-Specific Reasoning.effort Configurations

Constrains effort on reasoning for reasoning models. Currently supported values are none, minimal, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.

* gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1.
* All models before gpt-5.1 default to medium reasoning effort, and do not support none.
* The gpt-5-pro model defaults to (and only supports) high reasoning effort.
* xhigh is supported for all models after gpt-5.1-codex-max.

## Response Example

```json theme={null}
{
  "id": "resp-abc123",
  "object": "response",
  "created": 1699896916,
  "model": "gpt-4.1-2025-04-14",
  "output": "# Document Analysis Summary\n\n## Key Information:\n- Document Type: Financial Report Q3 2024\n- Total Pages: 45\n- Date: September 30, 2024\n\n## Main Topics:\n1. **Revenue Growth**: The company reported a 23% increase in quarterly revenue, reaching $4.2 billion\n2. **Market Expansion**: Successfully entered three new international markets in Asia-Pacific region\n3. **Product Innovation**: Launched two major product lines with positive customer reception\n4. **Operational Efficiency**: Reduced operational costs by 15% through process optimization\n\n## Financial Highlights:\n- Total Revenue: $4.2B (↑23% YoY)\n- Net Income: $850M (↑18% YoY)\n- Operating Margin: 28.5%\n- Cash Flow: $1.1B positive\n\n## Strategic Initiatives:\n- Investment in R&D increased by 30%\n- New partnership agreements with 5 major technology companies\n- Sustainability goals on track with 40% reduction in carbon emissions\n\n## Future Outlook:\nThe company maintains a positive outlook for Q4 2024, projecting continued growth driven by strong product demand and market expansion efforts.",
  "usage": {
    "prompt_tokens": 3500,
    "completion_tokens": 245,
    "total_tokens": 3745
  }
}
```

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