Skip to main content
Text models accept a prompt or conversation and return text. Some models also accept images or other input media. Input support does not imply that a model can generate that media type. Use the common Model Service authentication and permissions. Choose a model with the Text operation in Resources > Models.

Usage

Open Resources > Models, select a model, and open Usage to see copyable examples populated with that model’s exact ID.

Choose a client

Model Service Usage tab showing the Python SDK example and deployment credential guidance

Make an HTTP request

Copy a model ID from Resources > Models. Model availability and pricing can change, so use an ID from the live catalog instead of guessing a provider model name. Replace PASTE_MODEL_ID_HERE with the model ID you copied:
A successful request returns an OpenAI-compatible Response object containing the model output and token usage. Aion does not retain the response for later retrieval.

Use an SDK adapter

The Python SDK example uses aion_openai_config() with the OpenAI client. Framework adapters provide model objects configured for the same service:
For a configurable application, an llm field in aion.yaml lets a deployer choose a model from the live catalog. Application code passes that selected model ID to its SDK adapter.

Configure Codex

Set AION_API_KEY, then add Aion as a provider in your Codex home configuration:

Provider preferences and service tiers

Both creation endpoints accept optional provider and service_tier fields. These request options do not require a different model ID or a server configuration change.

Provider preferences

Set provider.sort to choose the order in which Model Service tries providers for your selected model: Low latency helps a response start sooner. High throughput helps long responses finish sooner. These preferences do not guarantee response times or select a different model. Omit provider.sort to retain the default provider selection. A provider sort option does not enable a different service tier.

Service tiers

Set one service_tier string per request, not an array. Model Service maps these names to each provider’s capacity options: Availability and rates depend on the model and provider. Responses report fast as priority. With fallbacks enabled, fast can use standard capacity. ultrafast can use fast, then standard capacity. If flex endpoints exist, flex does not fall back to standard capacity. Without flex endpoints, it uses standard rates. Check the response’s service_tier for the actual tier, or null if unavailable. The actual tier determines the applicable Aion rate.

SDK examples

Use service_tier as a keyword argument and extra_body for the provider object:
The LangGraph adapter accepts the same options:
Replace the model placeholder with a catalog ID. Adjust the output limit for your workload. For an HTTP request, put provider and service_tier at the top level of the JSON body, not inside an extra_body object. If your client’s type definitions do not accept a newer tier value, put service_tier in extra_body instead.

API behavior

Use stream: true or send Accept: text/event-stream to stream either creation endpoint. The Responses endpoint emits named events such as response.output_text.delta and response.completed. Chat Completions emits data frames and ends with [DONE]. The Responses endpoint is intentionally stateless. Set store to false, include the full conversation context in each request, and do not send stateful fields such as previous_response_id, conversation, or background: true.

Response cost

When Aion can calculate a price, usage.cost contains Aion’s USD quote for the returned result. The quote uses the applicable organization policy and the effective service tier. This applies to Chat Completions and Responses. It also applies to SSE events that contain usage. For Chat Completions streams, request stream_options: {"include_usage": true} to receive usage. An event without usage does not receive a cost field. If the quote is unavailable, Aion omits usage.cost and preserves the output. An absent cost does not mean a free request. The quote does not include other billable attempts and is not a final settlement receipt. Policy changes or later usage information can change the settled charge. Use Metrics and Aion billing records for settled charges in credits.

Troubleshoot a request

Other operations

Use Decisions for named probability, choice, score, and box questions. The Decisions API has its own HTTP contract. Text SDK adapters do not implement that contract.