API Guides

GPT-6 Luna: Basic Responses API Calls and LLMAPI Access Checks

OpenAI positions GPT-6 Luna for focused, high-volume tasks, including cost-sensitive workloads. Its official model ID is gpt-6-luna, and OpenAI lists its models as available through the Responses API and client SDKs. For a basic text request, start with a model ID and an input prompt, then read the generated text using the SDK’s output_text convenience property.

Connecting through LLMAPI is a separate configuration decision. Before adapting an official OpenAI example, verify the model ID, supported protocol, billing mode and permissions available to your LLMAPI key. An official model listing does not establish access through your LLMAPI account.

Where GPT-6 Luna fits

The OpenAI model catalog describes Luna as its most efficient model for focused, high-volume tasks. The GPT-6 guide likewise recommends Luna for focused, high-volume work rather than the most demanding workloads.

For an initial evaluation, choose a narrow text task with an explicit output requirement. Generic illustrative tasks include summarizing a short note in one sentence, rewriting a paragraph to a specified length, or assigning a short message to a category. These are evaluation ideas, not measured results or promises about Luna’s accuracy or throughput.

Keep the first request simple. The example below does not require tools or custom reasoning settings. Do not transfer Astra-specific prompting observations to Luna without evaluating them: OpenAI explicitly says its family-wide prompting starting points address behavior observed with Astra and should be evaluated with the chosen model and workload.

For official specifications and current OpenAI prices, consult the model catalog. For LLMAPI charges, use the LLMAPI channel catalog; it is a separate service catalog, not the official OpenAI specification or price list.

Make a basic Responses API text request

OpenAI’s text generation guide demonstrates client.responses.create with model and input. The following Python example adapts that documented pattern by selecting the official Luna model ID. It is an illustrative direct-OpenAI request, not a demonstrated LLMAPI call. Configure your OpenAI credentials before running it.

from openai import OpenAI

client = OpenAI()

response = client.responses.create(
    model="gpt-6-luna",
    input="Write a one-sentence bedtime story about a unicorn.",
)

print(response.output_text)

The two request fields have distinct purposes:

  • model selects gpt-6-luna, the ID in OpenAI’s model catalog.
  • input supplies the text prompt, following the simple-string input pattern in the text generation guide.

Replace the story prompt with your own small test case. Define the desired length, style or task boundary in that prompt, then inspect the result before expanding the workload. No sample output is asserted here; this is a request example rather than a recorded execution.

Read text without assuming the first output item is the answer

Responses API results include an output array. OpenAI warns that this array can contain more than text messages, including tool calls and reasoning-related items. Do not assume the answer is always at output[0].content[0].text.

For the Python pattern above, use response.output_text. OpenAI documents this convenience property in supported SDKs as aggregating text outputs into a single string. If you work with the raw response instead, inspect its output items rather than hard-coding the first item as the text answer.

This distinction is useful even when starting with a minimal text request: keep request construction and response parsing separate so your application does not depend on an assumed array position.

Check LLMAPI protocol, model ID and billing key separately

The LLMAPI documentation specifies https://llmapi.pro/v1 as the base URL for OpenAI-compatible clients. That base URL is a configuration value—not proof that a particular model, endpoint or feature is enabled for your account.

Before adapting the example to LLMAPI, complete these checks:

Check What to verify
Billing mode Decide whether you are using a monthly subscription or pay-as-you-go API billing.
Key type Use the subscription key for subscription access, or the separate API billing key for metered access.
Request model ID Copy the exact request ID from the relevant live catalog, rather than a display name.
Protocol and features Check that the selected model and account support your client protocol and the Responses API operation you intend to use.
Allowance or balance Check the allowance or balance belonging to that key’s billing mode.

The model-selection documentation treats model names, protocol compatibility and billing mode as separate settings. It also identifies the live catalog and key permissions as authoritative for model IDs, protocols and features. Do not assume that OpenAI compatibility means every model is included in a subscription.

The billing distinction matters:

  • Monthly subscription: a subscription key uses the plan allowance, shared by supported models.
  • Pay-as-you-go API: a separate key uses a separate balance, with pricing determined by the selected channel.
  • API credit top-ups do not increase subscription quota. Metered keys and subscription keys are not interchangeable.

Use the channel catalog to check current metered model availability, supported protocols and prices. Confirm Luna access and the required operation there and in your account before treating the official example as a gateway integration recipe.

Separate URL checks from authenticated request checks

The API setup tool checks LLMAPI URL formatting locally in your browser. It makes no API request and requires no API key. A passing format check therefore does not validate credentials, model permissions or successful inference.

When troubleshooting an actual request, use the setup guide’s checks:

  • 401: verify the service that issued the key and whether the key is active.
  • 404: compare the protocol and final request path; check for an extra or missing /v1.
  • 403 or 429: check account access, quota and concurrency limits. Avoid repeated rapid retries.
  • 5xx: retain the timestamp and request ID, then retry later or share a redacted error with support.

Keep the initial integration goal narrow: a basic text request using an account-authorized model and supported protocol, followed by correct text extraction. Only then evaluate additional settings against your actual workload.

分享这篇文章

开始使用 LLM API

免费套餐可用。Claude Code 一行配置。

免费开始