An AI model API lets your application request a model operation through a documented interface. The application supplies input, receives a result and remains responsible for deciding whether that result is usable.
Definition with a live example
An API is a contract between software systems. In a model API, the request identifies the operation and supplies material such as text, media or structured tool information. The response provides the model’s output and related metadata. Your application uses that contract to connect inference to a product workflow instead of relying on a person to copy material between interfaces.
Claude, OpenAI and Gemini expose their model services through documented request interfaces and client libraries. Official documentation.
A provider is the service receiving and authenticating the call. A model is the selected system that performs the inference. An endpoint is the request path for an operation. An SDK is a library that helps code construct requests and parse responses. Keeping those terms separate prevents a model comparison from hiding an endpoint change or a different account relationship.
| Model | Official identifier | Modalities | Context tokens | Input USD / 1M | Output USD / 1M | Status |
|---|---|---|---|---|---|---|
| gpt-5.6-luna | gpt-5.6-luna | text | 1,050,000 | $0.2 | $1.2 | Active |
| gpt-5.6-sol | gpt-5.6-sol | text | 1,050,000 | $4 | $20 | Active |
| gpt-5.6-terra | gpt-5.6-terra | text | 1,050,000 | $2 | $12 | Active |
| gpt-6-astra | gpt-6-astra | text | 1,050,000 | $10 | $50 | Active |
Last verified · Source ↗
The live model list illustrates the distinction. An entry has a name used by people and an identifier used by software, alongside supported attributes and source evidence. The identifier belongs in application configuration; the display label helps a person recognize the selection. Verify the exact route rather than sending an attractive model title as an API value.
Consider a document-extraction application. It receives a safe document, sends the relevant text and field instructions to a model, validates the returned fields and stores only accepted data. The model call is one stage. Document selection, validation, retries and storage remain application responsibilities. A fluent response does not automatically satisfy the field rules.

How it affects cost / limits / results
Cost follows the operations the application actually performs. A request may include more than the visible user question: instructions, conversation history, retrieved passages and tool definitions can all be part of the assembled input. A response can also be followed by repair or validation calls. Budget the complete accepted task rather than only a demonstration request.
Use the AI API cost calculator with a measured or explicitly assumed workload. Keep input, output and supported optional categories separate, then preserve the model and source dates with the result.
Throughput is an operating constraint. A model can be affordable per call while the account cannot accept the traffic pattern your worker creates. Design a queue and a task deadline, inspect actual rejection evidence and keep retry ownership in one layer. An application should expose a useful waiting or stopped state instead of producing an unexplained blank result.
Output quality is a separate constraint. Define acceptance before running a comparison: a supported answer, a valid structured object, a working patch or another task-specific result. Include an example that should fail gracefully. A model that always returns text can still fail the application if it invents a missing field or proposes an unauthorized action.
Credentials connect the request to account authority. Store them in protected server-side configuration, give the workload an owner and plan rotation. Keep usage records safe enough to diagnose failures without logging secrets or full private inputs. A first successful call should be followed by an operating record that explains how the service is maintained.
Provider differences
Anthropic documents the Messages interface and its content-block structure. Begin with the Claude quickstart and keep parsing aligned with the response types the application uses.
OpenAI uses Responses in its developer quickstart. A migration from another interface should include request options and result handling, not only the model name.
Google documents Gemini’s current Interactions path in the quickstart. Select the relevant feature guide when adding media, caching or asynchronous work.
These examples show why a shared word such as chat does not establish a shared wire format. Start from the provider’s minimum passing call, then add the application’s required features. Preserve each passing stage so a failure introduced by an optional field can be isolated.
A compatible host can reduce client changes while introducing a new account and serving path. Record the actual provider and model together. If a router permits fallback, decide which candidate changes are acceptable and retain the returned model identity in the evaluation.
Common mistakes
Do not confuse a successful HTTP exchange with an accepted task. Inspect error bodies, completion state and output validity. A partial stream or schema-invalid object needs an explicit application state even when some text was received.
Do not select a provider solely from a model family name. Inspect required input/output types, current identifiers, access conditions and the endpoint’s documented features. A model that understands images is not automatically the endpoint that generates them.
Do not use repeated retries to repair invalid input or an account funding condition. Preserve the actual error and choose the corrective action from its meaning. A bounded retry policy is useful for temporary failures, but it cannot change a malformed request into a valid one.
Do not deploy the example as an unattended service without a stop condition. Save the key owner, model configuration, acceptance fixture and usage assumptions. Those details turn a tutorial call into a maintainable application component.
Last verified · Source ↗
Frequently asked questions
What is an LLM API?
Is the provider the same as the model?
What does an SDK do?
Does a successful response prove the answer is correct?
Where should the key live?
What should I build first?
Sources
Last verified · Source ↗