GPT 6 Luna API
Call GPT 6 Luna through OpenAI-compatible Chat Completions. Check the input, output and cache rates before integrating it into your text workflow.
gpt-6-luna Catalog reference rates · billed on actual token usage
How do I display a reply as it arrives?
For a chat interface, set stream to true and read the response incrementally. Start with a standard request to check the message format before adding a stream reader.
POST /v1/chat/completionschoices[0].message.content Python
import os
import requests
response = requests.post(
"https://api.rokoapi.com/v1/chat/completions",
headers={"Authorization": "Bearer " + os.environ["API_KEY"]},
json={"model": "gpt-6-luna", "messages": [{"role": "user", "content": "Hello"}]},
timeout=60,
)
response.raise_for_status()
print(response.json()["choices"][0]["message"]["content"])JavaScript · Node.js
const response = await fetch("https://api.rokoapi.com/v1/chat/completions", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "gpt-6-luna",
messages: [{ role: "user", content: "Hello" }],
}),
});
if (!response.ok) throw new Error(String(response.status));
console.log((await response.json()).choices[0].message.content);Integration scenarios
-
Follow-up support: send the relevant turns and stream the reply to display text as it arrives.
Request example
POST https://api.rokoapi.com/v1/chat/completions{ "model": "gpt-6-luna", "messages": [ { "role": "user", "content": "Our webhook returns HTTP 401." }, { "role": "assistant", "content": "Check whether the Authorization header is present." }, { "role": "user", "content": "The header is present. What should I check next?" } ], "max_completion_tokens": 256, "stream": true }Observed response
Next, verify the **authentication format and value**, not just that a header exists: - Does the endpoint expect `Authorization: Bearer …`, `Basic …`, or a provider-specific signature? Webhooks often use a signature header instead of `Authorization`. - Check for typos, extra whitespace, wrong capitalization or encoding, and an expired or rotated credential. - Confirm the sender is using the credential for the right environment and endpoint (test vs. production). - Check whether a proxy, gateway, or serverless layer is removing or changing the header before it reaches your app. - Look at logs to identify which layer returns the 401—the provider, gateway, or your application202611221254505938784048268d9d6B7wQZjaO·finish_reason: length· USD 0.00012 -
Extract JSON: describe the expected keys in a message, then parse and validate in your application.
Request example
POST https://api.rokoapi.com/v1/chat/completions{ "model": "gpt-6-luna", "messages": [ { "role": "user", "content": "Return only a JSON object with summary and action fields. Ticket: The build failed because the lockfile references a removed package." } ], "max_completion_tokens": 256, "stream": false }Observed response
{"summary":"The build failed because the lockfile references a package that has been removed.","action":"Update or regenerate the lockfile to remove the stale package reference, then rerun the build to verify the fix."}202611221254577052278048268d9d6U2jViPdr·finish_reason: stop· USD 0.000046 -
Debugging: share a minimal safe error excerpt and ask for hypotheses your team can test.
Request example
POST https://api.rokoapi.com/v1/chat/completions{ "model": "gpt-6-luna", "messages": [ { "role": "user", "content": "A Node.js job processes the same webhook twice after a timeout. Suggest two causes and one reproducible test for each." } ], "max_completion_tokens": 256, "stream": false }Observed response
The generation token cap was reached before any answer text appeared.
202611221255031218619338268d9d6Hdn7s16K·finish_reason: length· USD 0.000118 -
Batch summaries: keep inputs concise and record usage to measure per-item cost.
Request example
POST https://api.rokoapi.com/v1/chat/completions{ "model": "gpt-6-luna", "messages": [ { "role": "user", "content": "Summarize in one sentence: The weekly import completed 820 rows and skipped 17 with invalid dates. No retry has run." } ], "max_completion_tokens": 256, "stream": false }
Request parameters
Common parameters
| Field | Details |
|---|---|
| string · Required | Use this public model ID.gpt-6-luna |
| array · Required | Pass ordered role/content objects. Include the relevant turns for follow-up requests. |
Advanced parameters
| Field | Details |
|---|---|
| boolean · Optional | Set true to request SSE deltas. Default false |
| integer · Optional | Cap the number of generated tokens.Affects cost |
Model pricing
Compare all public tiers and current prices for this series on one page.
Catalog reference rates · billed on actual token usage
- Input tokens
- $0.092 / 1M tokens
- Output tokens
- $0.45 / 1M tokens
- Cached input
- $0.092 / 1M tokens
- Cache write
- $0.115 / 1M tokens
- Cache write (1 hour)
- $0.184 / 1M tokens
- Image input tokens
- $0.092 / 1M tokens
- Audio input tokens
- $0.092 / 1M tokens
- Audio output tokens
- $0.092 / 1M tokens
Context tiers are not listed. Reference rates may not apply at every context length.
Context
—
Max output
—
- Model ID
-
gpt-6-luna - Available groups
- default, svip
- Capabilities
- chat
API reference
Base URL is https://api.rokoapi.com/v1. The model in requests must use the model IDs listed above.
curl https://api.rokoapi.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-luna",
"messages": [{"role":"user","content":"Introduce yourself in one sentence"}]
}' For more parameters, limits, and async task queries, read the GPT 6 Luna developer guide. GPT 6 Luna Developer guide · OpenAI · Authorization
Other OpenAI model series
FAQ
Which endpoint should I call?
Send an authenticated POST to /v1/chat/completions with model set to gpt-6-luna.
How is usage billed?
Use the catalog reference rates above to understand the billing dimensions. The final charge follows the actual usage.
Is a context limit listed?
The public catalog does not publish a context limit for this entry. Check the API response when testing longer requests.