API reference
The Smart Inference gateway exposes three OpenAI-compatible endpoints. All paths sit under /v1. The default production base URL is https://smart.aivory.net/v1.
- POST
/v1/chat/completions- chat completions, streaming or not - GET
/v1/models- what’s in the catalogue right now - GET
/v1/pricing- live per-model prices, filterable - GET
/v1/pricing/benchmark- price comparison against major cloud providers - GPU Rental - rent spot GPUs via
/v1/gpu/*(full reference)
Authentication
Every request needs a Bearer token.
A missing or invalid token returns 401 authentication_error. An empty balance returns 402 insufficient_credits. See Errors for the full table.
POST /v1/chat/completions
The main endpoint. Same shape as OpenAI chat completions.
Request body
{
"model": "llama-3.3-70b",
"messages": [
{"role": "system", "content": "You are a terse assistant."},
{"role": "user", "content": "Ship it."}
],
"temperature": 0.7,
"top_p": 1.0,
"max_tokens": 512,
"stream": false,
"stop": null,
"seed": null,
"tools": null,
"tool_choice": null,
"response_format": null
}
Required: model, messages. Everything else is optional. The model field also accepts the tier keywords light, medium, or high — the router picks the cheapest model in that tier. See Model catalogue for details.
For the full supported/unsupported parameter matrix, see SDK compatibility.
Non-streaming response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1744634400,
"model": "llama-3.3-70b",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Shipped." },
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 42,
"completion_tokens": 3,
"total_tokens": 45
}
}
Token counts are real, not estimated. That’s what we bill on.
Streaming response
Set "stream": true. You get Server-Sent Events, newline-delimited, in the OpenAI format.
The final chunk carries usage and finish_reason. The stream ends with data: [DONE] - the same marker OpenAI sends, so the OpenAI SDK parses it without changes.
If a stream is cut off mid-flight, you are billed for the tokens that actually arrived.
Global timeout
Requests are capped at 120 seconds end-to-end. Very long completions may be truncated; keep that in mind for batch work.
GET /v1/models
Returns every canonical model ID in the catalogue, with availability status and cost estimates.
{
"object": "list",
"data": [
{
"id": "llama-3.3-70b",
"object": "model",
"created": 0,
"owned_by": "smart-inference",
"providers": ["provider-a", "provider-b", "provider-c"],
"provider_count": 3,
"availability": "instant"
},
{
"id": "meta-llama/Llama-3.3-70B-Instruct",
"object": "model",
"owned_by": "smart-inference",
"availability": "deploying",
"estimated_deploy_seconds": 300,
"estimated_cost_per_hour": 1.20
}
]
}
Availability tiers
| Tier | Meaning |
|---|---|
instant |
Model is served by hosted API providers or an active spot GPU. No wait time. |
deploying |
A spot GPU is being provisioned. estimated_deploy_seconds gives the ETA. |
cold |
Model can be deployed on a spot GPU. First request triggers deployment (3-10 min) and places a credit hold for the minimum session cost. |
pricing_pending |
Model is available from a provider but pricing has not been confirmed yet. It will become routable once pricing is set. |
The providers array holds routing identifiers – not brand names – and is there for diagnostic use. If you just want names, read data[].id. Supports ?limit=N and ?offset=N for pagination.
GET /v1/pricing
Two response shapes. Pick with ?format=.
?format=flat (default)
One row per deployment. Cheapest per model rolls up on the client side.
{
"object": "list",
"count": 42,
"data": [
{
"canonical_model_id": "llama-3.3-70b",
"provider_id": "provider-a",
"model_id": "<opaque>",
"region": null,
"pricing": {
"type": "token",
"input_price_per_million": "0.36",
"output_price_per_million": "0.36",
"cached_input_price": null
},
"capabilities": {
"context_window": 131072,
"max_output_tokens": 4096,
"supports_function_calling": true,
"supports_json_mode": true,
"quality_tier": 2
},
"health": {
"status": "healthy",
"latency_p50_ms": 250,
"latency_p95_ms": 750,
"tokens_per_second": 50
},
"last_price_update": "2026-04-14T12:30:00Z"
}
]
}
?format=tiers
Grouped by quality tier (light, medium, high) with the cheapest input/output rates already rolled up.
Query filters
?model=<canonical-id>- single model?provider=<id>- only rows from a specific source
All three query parameters stack.
GET /v1/pricing/benchmark
Returns a comparison of AIVory prices against major cloud providers for a curated set of models.
{
"object": "benchmark_list",
"benchmarks": [
{
"canonical_model_id": "llama-4-maverick",
"model_meta": {
"display_name": "Llama 4 Maverick",
"context_window": 1048576,
"params_b": 400,
"open_weight": true
},
"our_price": {
"input_per_million": "0.13",
"output_per_million": "0.25"
},
"competitors": [
{ "vendor": "azure-ai-foundry", "label": "Azure AI", "input_per_million": "0.60", "output_per_million": "1.50" },
{ "vendor": "aws-bedrock", "label": "AWS Bedrock", "input_per_million": "0.55", "output_per_million": "1.30" }
]
}
],
"updated_at": "2026-05-18T00:00:00Z"
}
GPU Rental
Four endpoints for renting spot GPUs directly (/v1/gpu/*). The full reference — request bodies, query filters, response schemas — lives in the dedicated GPU docs:
| Endpoint | Method | Purpose |
|---|---|---|
/v1/gpu/offers |
GET | Browse available spot GPU offers with pricing |
/v1/gpu/rent |
POST | Start a GPU rental |
/v1/gpu/rentals/{id} |
GET | Check rental status |
/v1/gpu/rentals/{id} |
DELETE | Terminate a rental |
See also: GPU billing and GPU overview.
Not implemented
/v1/embeddings/v1/images/generations/v1/audio/speech/v1/files
If you need any of these, write to support.