Skip to main content
Model Service provides one Aion-managed interface for calling supported language models. It centralizes model discovery, authentication, permission checks, credit usage, and request attribution without requiring each application to manage a separate provider connection. Open Resources > Models to browse the current catalog. Each entry has an exact model ID, such as a provider-prefixed ID, that you pass to the API or an Aion SDK adapter.

Before you begin

You need:
  • an active Aion organization with Model Service access;
  • enough Aion credits for the request.

Authentication

Choose credentials based on where the caller runs:

Personal API key

Use a personal API key when calling the Model Service directly from a script, API client, or Codex. Open Settings > Personal > API Keys, create a key, and store it in your shell:
Send the key as a bearer token. It acts as your user in the active organization and is limited by your permissions. See API Keys for creation and security guidance.

Deployment client credentials

Aion deployments use AION_CLIENT_ID and AION_CLIENT_SECRET:
  • Remote Deployment: Aion displays both values after you create the deployment. Copy them immediately and add them to the runtime’s environment. The client secret is shown only once and cannot be retrieved later.
  • GitHub Deployment: Aion injects both values into the hosted runtime environment automatically.
The Aion SDK reads these variables, exchanges them for a short-lived Aion token, and refreshes the token as needed. SDK model adapters use that token automatically; do not send the raw client ID or secret to a model endpoint.

Permissions and attribution

Both authentication paths require model.execute in the organization. A personal API key acts as its user. A deployment call is authorized and attributed through the runtime’s Daemon Identity. Before sending work to a model, Aion also checks the organization’s credit policy. Usage records contain the model, token counts, Aion credits, result status, and responsible user or Identity. They do not contain the prompt or generated response. A failed or cancelled request can still use credits when the model reports consumed work.

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:

Browse model details and pricing

The Models list shows each model’s provider, prompt and completion price per million tokens, recent token usage, and invocation count. Search the catalog or filter it to models used recently. Models catalog showing search, reporting windows, model IDs, providers, pricing, tokens, and invocations Select a model to review its supported input and output modalities, context length, maximum completion size, knowledge cutoff, pricing, and other catalog metadata. The catalog is the source of truth for availability. Aion does not expose controls for enabling a model or configuring provider credentials on this page.

Monitor usage and cost

Select a model and open Metrics to inspect Invocations, Prompt Tokens, Completion, Total Cost, and Principal Attribution. Use the 24h, 7d, and 30d controls to change the reporting window. Model metrics showing invocations, prompt tokens, completions, total cost, and principal attribution

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.

Troubleshoot a request

What to do next