Skip to main content
POST
/
v1
/
responses
gpt-5.2-pro (Image to Text (Response))
curl --request POST \
  --url https://api.example.com/v1/responses

API Key Authentication

GPTProto API uses Bearer token authentication. All API requests must include your API key (sk-xxxxx) in the Authorization header.

Getting Your API Key

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

Initiate Request

curl --location --request POST 'https://gptproto.com/v1/responses' \
--header 'Authorization: GPTPROTO_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gpt-5.2-pro",
    "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"
                }
            ]
        }
    ]
}'

Response Example

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1699896916,
  "model": "gpt-5.2-pro",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The image shows a wooden boardwalk path extending through a lush green grassland."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 1250,
    "completion_tokens": 89,
    "total_tokens": 1339
  }
}

Parameters

Core Parameters

ParameterTypeRequiredDefaultRangeDescription
modelstring✅ Yes--Model ID used to generate the response, like gpt-4o or o3.
inputstring/array✅ Yes--Input content for the model.
>input.rolestring✅ Yes-user
assistant
system
developer
The role of the message input. One of user, assistant, system, or developer.
>input.contentstring/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 for details.

Advanced Parameters

ParameterTypeRequiredDefaultRangeDescription
streamboolean❌ Nofalsetrue
false
Whether to stream the response back incrementally. Defaults to false.
max_output_tokensinteger❌ No--An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
reasoningobject❌ No--Configuration options for reasoning models (gpt-5 and o-series models only).
>reasoning.effortstring❌ Nomediumnone
minimal
low
medium
high
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 for details.
>reasoning.summarystring❌ No-auto
concise
detailed
A summary of the reasoning performed by the model. Useful for debugging and understanding the model’s reasoning process.
toolsarray❌ 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 for details.

Multimodal Input

{
  "role": "user",
  "content": [
    {
      "type": "input_text",
      "text": "Who are you?"
    }
  ]
}
parameterTypeRequiredDefaultRange / ExampleDescription
content.typestring✅ Yesinput_text
input_image
input_file
Identifies the content block type for multimodal input.
content.textstring❌ No-The text input to the model.
content.file_idstring❌ No--The ID of the file to be sent to the model.
content.detailstring❌ Noautohigh
low
auto
The detail level of the image to be sent to the model. One of high, low, or auto. Defaults to auto.
Only required when type=input_image.
content.image_urlstring❌ No--The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
Only required when type=input_image.
content.file_urlstring❌ No--The URL of the file to be sent to the model.
Only required when type=input_file.
content.file_datastring❌ No--The content of the file to be sent to the model.
Only required when type=input_file.
content.filenamestring❌ No--The name of the file to be sent to the model.
Only required when type=input_file.

Tools Parameters

{
  "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"
        }
    }
  ]
}
parameterTypeRequiredDefaultRange / ExampleDescription
typestring✅ Yesweb_search
web_search_2025_08_26
The type of the web search tool. One of web_search or web_search_2025_08_26.
filtersobject❌ No--Filters for the search.
>filters.allowed_domainsstring❌ 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_sizestring❌ Nomediumlow
medium
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_locationobject❌ No--The approximate location of the user.
>user_location.citystring❌ No--Free text input for the city of the user, e.g. San Francisco.
>user_location.countrystring❌ No--The two-letter ISO country code of the user, e.g. US.
>user_location.regionstring❌ No--Free text input for the region of the user, e.g. California.
>user_location.timezonestring❌ No--The IANA timezone of the user, e.g. America/Los_Angeles.
>user_location.typestring❌ Noapproximate-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.

Error Codes

Common Error Codes

Error CodeError NameDescription
401UnauthorizedAPI key is missing or invalid
403ForbiddenYour API key doesn’t have permission to access this resource, or insufficient balance for the requested operation
429Too Many RequestsYou’ve exceeded your rate limit
500Internal server errorAn internal server error occurred
503Content policy violationContent blocked due to safety concerns (actual status code is 400)