Skip to content
English

GPT-6 Luna API

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

The OpenAI-compatible Responses endpoint is recommended for this model, while /v1/chat/completions remains available for compatibility. The same HiAPI API key works across enabled models; media models use /v1/tasks and a different request shape.

Model overview

Model IDgpt-6-luna
ProviderOpenAI
TypeText generation · Responses (default) and Chat Completions
Input / outputText and images → text
Context window1,050,000 tokens (up to 922,000 input per request)
Max output128,000 tokens
Knowledge cutoff2026-05-18
Reasoning effortsnone / low / medium / high / xhigh / max
Examples / Playground effortmedium
PricingLive HiAPI token rates

Integrate OpenAI GPT-6 Luna through HiAPI Responses, with Chat Completions also available, for summaries, information extraction, quick Q&A, and other high-volume tasks.

Production guidance

Request contract
  • Responses: use POST /v1/responses with an input array, stream=true, and store=false. A string input returns HTTP 400. Omit temperature, top_p, and max_output_tokens.
  • Chat Completions: POST /v1/chat/completions also works, streaming or non-streaming, with reasoning_effort. Omit temperature, top_p, max_tokens, and max_completion_tokens.
  • Use none, low, medium, high, xhigh, or max for reasoning.effort (Responses) or reasoning_effort (Chat). The default is medium.
  • To hit the prompt cache, send the same stable value in the prompt_cache_key body field and the session_id request header, and keep the prompt prefix identical. Cached tokens usually appear from the 2nd to 4th request; without both, no cache hit occurs.
  • The same HiAPI API key works across enabled models. Media models use /v1/tasks with a different request body.
  • Responses streaming: handle response.completed, response.incomplete, and response.failed separately.

Best suited for

Summaries and information extraction

Condense long documents and pull structured fields out of text or images at low cost.

inputtext
High-volume quick Q&A

Run focused, repetitive requests in volume, and pick a reasoning effort per task.

reasoning.effortinput

Request parameters

model string required

Use this exact public model ID.

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

Message items. A plain string is rejected with HTTP 400. Text and input_image parts are supported. Replay the context needed for each turn.

stream boolean optional

Must be true on Responses. Process the response as SSE.

default true
store boolean optional

Must be false. Keep conversation state in your client.

default false
instructions string optional

Optional instructions for the response.

reasoning object optional

Reasoning configuration.

effort enum optional

Use none, low, medium (default), high, xhigh, or max.

example medium enum: nonelowmediumhighxhighmax
prompt_cache_key string optional

Stable session identifier for prompt cache hits. Send the same value in the session_id request header, and keep the prompt prefix identical.

tools array optional

Function tool definitions. Execute functions in your application and return their results.

tool_choice string | object optional

Select automatic or a specific function call.

text object optional

Output format settings.

API examples

Request examples

Reasoning effort: none

Only the reasoning effort changes.

Request body
{
  "model": "gpt-6-luna",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Summarize the three highest risks in this project plan."
        }
      ]
    }
  ],
  "stream": true,
  "store": false,
  "reasoning": {
    "effort": "none"
  }
}
Reasoning effort: low

Only the reasoning effort changes.

Request body
{
  "model": "gpt-6-luna",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Summarize the three highest risks in this project plan."
        }
      ]
    }
  ],
  "stream": true,
  "store": false,
  "reasoning": {
    "effort": "low"
  }
}
Reasoning effort: high

Only the reasoning effort changes.

Request body
{
  "model": "gpt-6-luna",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Summarize the three highest risks in this project plan."
        }
      ]
    }
  ],
  "stream": true,
  "store": false,
  "reasoning": {
    "effort": "high"
  }
}
Reasoning effort: xhigh

Only the reasoning effort changes.

Request body
{
  "model": "gpt-6-luna",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Summarize the three highest risks in this project plan."
        }
      ]
    }
  ],
  "stream": true,
  "store": false,
  "reasoning": {
    "effort": "xhigh"
  }
}
Reasoning effort: max

Only the reasoning effort changes.

Request body
{
  "model": "gpt-6-luna",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Summarize the three highest risks in this project plan."
        }
      ]
    }
  ],
  "stream": true,
  "store": false,
  "reasoning": {
    "effort": "max"
  }
}
Image input

Send an input_image part together with text.

Request body
{
  "model": "gpt-6-luna",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Describe the main subject and two visible details."
        },
        {
          "type": "input_image",
          "image_url": "https://static.hiapi.ai/example/subject-1.jpg"
        }
      ]
    }
  ],
  "stream": true,
  "store": false,
  "reasoning": {
    "effort": "medium"
  }
}

Response schema

This illustrative SSE sequence shows text arriving before completion. Accumulate response.output_text.delta and read usage from response.completed. Handle incomplete and failed terminal events.

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

event: response.completed
data: {"type":"response.completed","response":{"id":"resp_example","model":"gpt-6-luna","status":"completed","output":[],"usage":{"input_tokens":100,"input_tokens_details":{"cached_tokens":0,"cache_write_tokens":0},"output_tokens":10,"total_tokens":110}}}
  1. Dispatch by event type and stop at a terminal response event.
  2. Accumulate text deltas; do not require response.completed.output to contain the full text.
  3. Read input_tokens, output_tokens, cache details, and total_tokens from usage. Count cache reads and writes only when usage reports them; cached tokens are included in the input total and reasoning_tokens are included in output_tokens. Above 272,000 input tokens, the long-context rates apply to the whole request. Use account logs for settled charges.

FAQ

Which endpoint and model ID should I use?

Use model=gpt-6-luna with POST /v1/responses (default), with an input array, stream=true, and store=false. POST /v1/chat/completions also works.

Which reasoning efforts are supported?

Six: none, low, medium (default), high, xhigh, and max. Use reasoning.effort on Responses and reasoning_effort on Chat Completions.

Can I use sampling controls or output limits?

No. Omit temperature, top_p, and max_output_tokens on Responses, and temperature, top_p, max_tokens, and max_completion_tokens on Chat Completions.

Does it accept images?

Yes. Send text and image input; the output is text. Audio and video are not covered by this page.

How do I continue a conversation?

Keep conversation state in your client and replay the required context on each request (input on Responses, messages on Chat Completions).

How do I get prompt cache hits?

Send the same stable value (for example a session ID) in the prompt_cache_key body field and the session_id request header, and keep the prompt prefix identical. Cached tokens usually appear from the 2nd to 4th request. Without both, there is no cache hit.

How are tokens billed?

Read current input, output, cache-read, and cache-write rates on the live model page. Count cache reads and writes only when usage reports them; cached tokens are included in the input total and reasoning_tokens are included in output_tokens, so do not add them again. View live pricing.

When does long-context pricing apply?

The threshold uses total input for the request, including reported cache reads and writes. At 272,000 tokens the standard tier still applies; from 272,001, the long-context rates apply to the whole request, including output and cache. View live pricing.

Next steps