Skip to content

GPT 5.6 Terra ​

This page is generated from the upstream official OpenAPI documentation. Endpoints, parameters and examples match the official docs; brand and API domain are replaced with ModelFold.

Endpoint ​

POST /codex/v1/responses

Full URL: https://ai.modelfold.online/codex/v1/responses

Authentication: every request must include the Authorization: Bearer <API_KEY> header.

GPT 5.6 Terra uses an OpenAI Responses–compatible endpoint (input/output items and response.* streaming events).

Context window: 272K tokens. The response's model field uses the dotted name (e.g. gpt-5.6-sol); both spellings are accepted in requests. List the currently available models with GET /openai/v1/models.

  • Multimodal Input — Supports mixed text, image, and file inputs in a single message.

  • Reasoning Control — Adjustable reasoning effort from low to max.

  • Tools & Web Search — Integrates web search or custom function calling tools.

  • Unified Endpoint — Uses the unified /codex/v1/responses endpoint with model set to one of gpt-5-6-terra .

Tools & tool_choice ​

The tools array enables web search or function calling capabilities. ::: caution Web Search and Function Calling are mutually exclusive.
In a single request you should choose only one: do not include both {"type": "web_search"} and {"type": "function", ...} in the same tools array. :::

Web Search

Use the built-in Web Search tool to retrieve up-to-date information:

json
{
  "tools": [
    {
      "type": "web_search"
    }
  ]
}

Function Calling

Define business functions that the model can call when needed:

json
{
  "tools": [
    {
      "type": "function",
      "name": "get_current_weather",
      "description": "Get the current weather in a given location",
      "parameters": {
        "type": "object",
        "properties": {
          "location": {
            "type": "string",
            "description": "The city and state, e.g. San Francisco, CA"
          },
          "unit": {
            "type": "string",
            "enum": ["celsius", "fahrenheit"]
          }
        },
        "required": ["location", "unit"]
      }
    }
  ],
  "tool_choice": "auto"
}

When function tools are configured in tools, set tool_choice to "auto" so the model can decide when to call them.
If you do not configure any function tools, omit the tool_choice field.

Error handling ​

Check the response body, not only the HTTP status. Errors are returned either as {"code": ..., "msg": "..."} (for example 401 invalid API key, 402 insufficient credits, 429 rate limited; the HTTP status may still be 200) or as {"error": {"type": "...", "message": "..."}}.

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
modelstringYesTarget model name. Allowed values: gpt-5-6-terra. Default:"gpt-5-6-terra"。 Allowed values:gpt-5-6-terra。 示例:gpt-5-6-terra。
streambooleanNoDefaults to true (Server-Sent Events). Set to false to receive a single JSON response. Default:true。 示例:true。
input`stringarray<object>`Yes
reasoningobjectNoReasoning configuration for the model.
  reasoning.effortstringNoReasoning effort: low, medium, high, xhigh or max. Defaults to medium. Default:"medium"。 Allowed values:low / medium / high / xhigh / max。 示例:low。
tools`array<objectobject>`No
tool_choicestringNoTool selection behavior. When function tools are configured in tools, set this to auto so the model can decide when to call them. 示例:auto。
textobjectNotext.format: {"type":"json_schema","name":"...","strict":true,"schema":{...}} makes the output follow your JSON Schema.
  text.formatobjectYesOutput format definition.
    text.format.typestringYesFixed value: json_schema.
    text.format.namestringYesSchema name, used to identify this schema.
    text.format.strictbooleanYesWhether to enable strict mode. When true, the output must strictly conform to the schema.
    text.format.schemaobjectYesJSON Schema of the output object, e.g. {"type":"object","properties":{"answer":{"type":"string"}},"required":["answer"],"additionalProperties":false}.

Request Example ​

bash
curl -X POST "https://ai.modelfold.online/codex/v1/responses" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-5-6-terra",
  "stream": false,
  "input": [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "What is in this image?"
        },
        {
          "type": "input_image",
          "image_url": "https://file.aiquickdraw.com/custom-page/akr/section-images/1759055072437dqlsclj2.png"
        }
      ]
    }
  ],
  "tools": [
    {
      "type": "web_search"
    }
  ],
  "reasoning": {
    "effort": "high"
  }
}'
json
{
  "model": "gpt-5-6-terra",
  "stream": false,
  "input": [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "What is in this image?"
        },
        {
          "type": "input_image",
          "image_url": "https://file.aiquickdraw.com/custom-page/akr/section-images/1759055072437dqlsclj2.png"
        }
      ]
    }
  ],
  "tools": [
    {
      "type": "web_search"
    }
  ],
  "reasoning": {
    "effort": "high"
  }
}

Response ​

200 — Request successful. ​

json
"{\n  \"output\": [\n    {\n      \"type\": \"reasoning\",\n      \"id\": \"rs_xxx\",\n      \"summary\": []\n    },\n    {\n      \"type\": \"message\",\n      \"role\": \"assistant\",\n      \"id\": \"msg_xxx\",\n      \"content\": [\n        {\n          \"type\": \"output_text\",\n          \"text\": \"Hello! How can I help you today?\"\n        }\n      ],\n      \"status\": \"completed\"\n    }\n  ],\n  \"usage\": {\n    \"total_tokens\": 4490,\n    \"output_tokens\": 47,\n    \"input_tokens\": 4443\n  },\n  \"credits_consumed\": 0.48,\n  \"status\": \"completed\"\n}"

400 — Bad Request - Invalid request parameters ​

参数类型必填说明
errorobject否—
  error.messagestring否示例:Invalid request parameters。
  error.typestring否示例:invalid_request_error。
json
{
  "error": {
    "message": "Invalid request parameters",
    "type": "invalid_request_error"
  }
}

401 — Unauthorized - Invalid or missing API key ​

参数类型必填说明
errorobject否—
  error.messagestring否示例:Unauthorized。
  error.typestring否示例:authentication_error。
json
{
  "error": {
    "message": "Unauthorized",
    "type": "authentication_error"
  }
}

429 — Rate Limited - Too many requests ​

参数类型必填说明
errorobject否—
  error.messagestring否示例:Rate limit exceeded。
  error.typestring否示例:rate_limit_error。
json
{
  "error": {
    "message": "Rate limit exceeded",
    "type": "rate_limit_error"
  }
}

500 — Server error. ​

ModelFold — one API for all the best AI models.