Skip to content
English

GPT-6 Astra API

POST Base URL: https://api.hiapi.ai /v1/responses

This model uses the OpenAI Responses endpoint. The same HiAPI API key works across enabled models; media models use /v1/tasks and a different request shape.

Model overview

Model IDgpt-6-astra
ProviderOpenAI
TypeText generation · streaming Responses
Reasoning effortslow / medium / high / xhigh / max
Examples / Playground effortmedium
PricingLive HiAPI token rates

Integrate OpenAI GPT-6 Astra through HiAPI streaming Responses for text generation, reasoning, function calls, and strict JSON Schema output.

Production guidance

Request contract
  • Use POST /v1/responses, an input array, stream=true, and store=false.
  • This integration does not expose Chat Completions, native non-streaming calls, image input, or compact requests.
  • Omit max_output_tokens, temperature, and top_p. Do not use reasoning.effort=none.
  • The same HiAPI API key works across enabled models. Keep it on your server; media generation uses /v1/tasks with a different request body.
Usage and context tiers
  • Use the live model pricing section for input, output, cache-read, and cache-write rates; documentation does not freeze sale prices.
  • Select the context tier from total input tokens, including cache reads and writes. Above 272,000 input tokens, the long-context rates apply to the whole request, including output; this is not incremental pricing on only the excess.
  • Cache reads and writes are included in input_tokens. Ordinary input is input_tokens minus both cache counts. reasoning_tokens are included in output_tokens; do not add them again.

Best suited for

Reasoning and code review

Choose effort for the task and consume text deltas as they arrive.

reasoning.effortinput
Application workflows

Connect function calls and validate structured results.

toolstext.format

Request parameters

model string required

Use this exact public model ID.

example gpt-6-astra enum: gpt-6-astra
input array required

Message and function-call items. Replay the required conversation context on each request; a bare string is not supported.

stream boolean required

Must be true. Process the response as SSE.

default true
store boolean required

Must be false. Keep conversation state in your client.

default false
instructions string optional

Optional role and response instructions.

reasoning object optional

Configure reasoning effort.

effort enum optional

Examples and Playground select medium. API callers should set reasoning.effort explicitly; no omission default is specified here. Higher effort can increase latency and output usage.

example medium enum: lowmediumhighxhighmax
text object optional

Structured output configuration.

format object optional

Use json_object for JSON mode, or json_schema for strict schema validation.

type enum required
enum: json_objectjson_schema
name string optional

Required for json_schema.

strict boolean optional

Set true for the strict json_schema contract.

example true
schema object optional

Required for json_schema: declare required fields and additionalProperties: false.

tools array optional

Function definitions with type, name, description, and parameters. Execute requested functions in your application.

tool_choice string | object optional

Use auto or select a named function as shown below.

API examples

Request examples

Reasoning effort: low

Only the reasoning effort changes; keep the streaming request contract.

Request body
{
  "model": "gpt-6-astra",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Review this service design and list the top three risks."
        }
      ]
    }
  ],
  "stream": true,
  "store": false,
  "reasoning": {
    "effort": "low"
  }
}
Reasoning effort: high

Only the reasoning effort changes; keep the streaming request contract.

Request body
{
  "model": "gpt-6-astra",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Review this service design and list the top three risks."
        }
      ]
    }
  ],
  "stream": true,
  "store": false,
  "reasoning": {
    "effort": "high"
  }
}
Reasoning effort: xhigh

Only the reasoning effort changes; keep the streaming request contract.

Request body
{
  "model": "gpt-6-astra",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Review this service design and list the top three risks."
        }
      ]
    }
  ],
  "stream": true,
  "store": false,
  "reasoning": {
    "effort": "xhigh"
  }
}
Reasoning effort: max

Only the reasoning effort changes; keep the streaming request contract.

Request body
{
  "model": "gpt-6-astra",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Review this service design and list the top three risks."
        }
      ]
    }
  ],
  "stream": true,
  "store": false,
  "reasoning": {
    "effort": "max"
  }
}
Strict JSON Schema

Collect output text and validate it against the schema after response.completed.

Request body
{
  "model": "gpt-6-astra",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Return a JSON object with status set to ok."
        }
      ]
    }
  ],
  "stream": true,
  "store": false,
  "reasoning": {
    "effort": "medium"
  },
  "text": {
    "format": {
      "type": "json_schema",
      "name": "status_result",
      "strict": true,
      "schema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          }
        },
        "required": [
          "status"
        ],
        "additionalProperties": false
      }
    }
  }
}
JSON object

Request valid JSON without supplying a schema; include the JSON requirement in the prompt.

Request body
{
  "model": "gpt-6-astra",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Return a JSON object with status set to ok."
        }
      ]
    }
  ],
  "stream": true,
  "store": false,
  "reasoning": {
    "effort": "medium"
  },
  "text": {
    "format": {
      "type": "json_object"
    }
  }
}
Function call

Collect function-call arguments, run the function, and replay the returned call item plus a function_call_output item with its call_id in the next input array.

Request body
{
  "model": "gpt-6-astra",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Look up the status of task demo-123."
        }
      ]
    }
  ],
  "stream": true,
  "store": false,
  "reasoning": {
    "effort": "medium"
  },
  "tools": [
    {
      "type": "function",
      "name": "get_task_status",
      "description": "Look up a task by ID.",
      "parameters": {
        "type": "object",
        "properties": {
          "task_id": {
            "type": "string"
          }
        },
        "required": [
          "task_id"
        ],
        "additionalProperties": false
      }
    }
  ],
  "tool_choice": {
    "type": "function",
    "name": "get_task_status"
  }
}

Response schema

This illustrative SSE sequence shows text arriving before completion; response.completed.output may be empty. Collect response.output_text.delta, or use response.output_item.done as a completed-item fallback without duplicating text. Read final usage from response.usage. The token numbers illustrate fields, not measured cache-write activity; optional usage fields may be omitted. Handle response.incomplete and response.failed separately; do not assume Chat Completions [DONE] framing.

event: response.output_text.delta
data: {"type":"response.output_text.delta","delta":"OK"}

event: response.output_item.done
data: {"type":"response.output_item.done","output_index":0,"item":{"id":"msg_example","type":"message","role":"assistant","status":"completed","content":[{"type":"output_text","text":"OK"}]}}

event: response.completed
data: {"type":"response.completed","response":{"id":"resp_example","model":"gpt-6-astra","status":"completed","output":[],"usage":{"input_tokens":100,"input_tokens_details":{"cached_tokens":0,"cache_write_tokens":0},"output_tokens":10,"output_tokens_details":{"reasoning_tokens":8},"total_tokens":110}}}
  1. Dispatch by event type. Stop on a terminal response event and distinguish success, incomplete output, and failure.
  2. Accumulate text deltas or retain output_text from response.output_item.done; do not rely on response.completed.output, which may be empty. Function calls use function_call items and response.function_call_arguments.delta.
  3. Read input_tokens, output_tokens, input_tokens_details.cached_tokens, input_tokens_details.cache_write_tokens, and total_tokens. Use account usage logs for settled charges.

FAQ

Which endpoint and model ID should I use?

Use POST /v1/responses with model=gpt-6-astra, input as an array, stream=true, and store=false.

Which reasoning efforts are supported?

Use low, medium, high, xhigh, or max. The examples and Playground select medium. API callers should set reasoning.effort explicitly; none is not supported.

How do I keep conversation context?

With store=false, replay the necessary messages and tool-call items in input for each turn. Do not rely on server-stored response chaining.

How are long-context and cache tokens billed?

The full input count, including cache, selects the context tier. Above 272,000 input tokens, the selected rates apply to all input, output, and cache tokens. Read current rates on the live model page. View live pricing.

Can I use an OpenAI SDK?

Use a Responses-capable client with the HiAPI base URL and API key, then iterate streaming events. Follow this model’s request fields instead of a Chat Completions example.

Next steps