Gpt 6 Astra
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 6 Astra 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-6-astra .
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:
{
"tools": [
{
"type": "web_search"
}
]
}Function Calling
Define business functions that the model can call when needed:
{
"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)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Target model name. Allowed values: gpt-6-astra. Default:"gpt-6-astra"。 Allowed values:gpt-6-astra。 示例:gpt-6-astra。 |
stream | boolean | No | Defaults to true (Server-Sent Events). Set to false to receive a single JSON response. Default:true。 示例:true。 |
input | `string | array<object>` | Yes |
reasoning | object | No | Reasoning configuration for the model. |
reasoning.effort | string | No | Reasoning effort: low, medium, high, xhigh or max. Defaults to medium. Default:"medium"。 Allowed values:low / medium / high / xhigh / max。 示例:low。 |
tools | `array<object | object>` | No |
tool_choice | string | No | Tool selection behavior. When function tools are configured in tools, set this to auto so the model can decide when to call them. 示例:auto。 |
text | object | No | text.format: {"type":"json_schema","name":"...","strict":true,"schema":{...}} makes the output follow your JSON Schema. |
text.format | object | Yes | Output format definition. |
text.format.type | string | Yes | Fixed value: json_schema. |
text.format.name | string | Yes | Schema name, used to identify this schema. |
text.format.strict | boolean | Yes | Whether to enable strict mode. When true, the output must strictly conform to the schema. |
text.format.schema | object | Yes | JSON Schema of the output object, e.g. {"type":"object","properties":{"answer":{"type":"string"}},"required":["answer"],"additionalProperties":false}. |
Request Example
curl -X POST "https://ai.modelfold.online/codex/v1/responses" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-astra",
"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"
}
}'{
"model": "gpt-6-astra",
"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.
"{\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
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | 否 | — |
error.message | string | 否 | 示例:Invalid request parameters。 |
error.type | string | 否 | 示例:invalid_request_error。 |
{
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}401 — Unauthorized - Invalid or missing API key
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | 否 | — |
error.message | string | 否 | 示例:Unauthorized。 |
error.type | string | 否 | 示例:authentication_error。 |
{
"error": {
"message": "Unauthorized",
"type": "authentication_error"
}
}429 — Rate Limited - Too many requests
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
error | object | 否 | — |
error.message | string | 否 | 示例:Rate limit exceeded。 |
error.type | string | 否 | 示例:rate_limit_error。 |
{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error"
}
}