Provider configuration
Use this reference for provider compatibility flags, authorization, and cost estimates in Aperture.
For provider API formats, setup links, and requirements, refer to the provider matrix in Supported providers and clients.
For client API formats and setup requirements, refer to clients and agent harnesses.
For compatibility restrictions and generic integrations, refer to limitations and other providers and clients.
Compatibility flags
The compatibility object in a provider configuration specifies which API formats the provider supports. These flags determine which endpoints Aperture exposes for the provider's models.
| Flag | Type | Default | Description |
|---|---|---|---|
openai_chat | boolean | true unless another flag is enabled | Supports /v1/chat/completions. Set explicitly to retain or disable it alongside other flags. |
openai_responses | boolean | false | Supports /v1/responses |
anthropic_messages | boolean | false | Supports /v1/messages |
gemini_generate_content | boolean | false | Supports the direct Gemini API (generativelanguage.googleapis.com) |
bedrock_model_invoke | boolean | false | Supports Amazon Bedrock InvokeModel. Request format depends on the model family. |
google_generate_content | boolean | false | Supports Gemini Enterprise Agent Platform Gemini format (aiplatform.googleapis.com) |
google_raw_predict | boolean | false | Supports Gemini Enterprise Agent Platform raw predict for Anthropic models |
bedrock_converse | boolean | false | Supports Amazon Bedrock Converse API format |
Enable a flag for each API format your provider supports. For example, a Gemini Enterprise Agent Platform provider can use separate flags for Gemini and Anthropic models.
If you enable another flag and omit openai_chat, Aperture disables Chat Completions. Set "openai_chat": true to keep it enabled, or "openai_chat": false to disable it explicitly.
Additional provider fields
Providers also support the optional fields below. Refer to the Aperture configuration reference for all provider fields.
| Field | Type | Default | Description |
|---|---|---|---|
description | string | "" | Human-readable description of the provider. |
preference | integer | 0 | Routing priority. Higher values are preferred when multiple providers serve the same model. |
disabled | boolean | false | Excludes the provider from routing and the /v1/models endpoint. Use this field to temporarily disable a provider without removing its configuration. |
Authorization types
The authorization field selects the upstream header format. Anthropic uses x-api-key, and direct Google Gemini uses x-goog-api-key. The other named providers in the provider matrix use bearer, which is also the default for generic and self-hosted providers.
| Value | Header format | Used by |
|---|---|---|
bearer | Authorization: Bearer <key> | OpenAI and most providers |
x-api-key | x-api-key: <key> | Anthropic |
x-goog-api-key | x-goog-api-key: <key> | Google Gemini |
hec | Authorization: Splunk <key> | Splunk HTTP Event Collector |
cf-aig-authorization | cf-aig-authorization: Bearer <key> | Cloudflare AI Gateway |
The authorization field is not required for all providers. For example, the Gemini Enterprise Agent Platform uses a service account key file instead of an API key (prefixed with keyfile::). Refer to set up a Gemini Enterprise Agent Platform provider for step-by-step configuration instructions.
Credential source
The auth_mode field selects whether Aperture uses the configured apikey or the client's credential. It is independent of authorization, which sets the header format.
| Value | Behavior |
|---|---|
"" (default) | Inject the configured apikey on every request. |
override | Explicit form of the default. Inject the configured apikey. Requires a non-empty apikey, or the configuration fails to save. |
passthrough | Forward the client's own Authorization or x-api-key header to the upstream unchanged. Fall back to the configured apikey only when the client sends no credential. |
none | Strip all upstream credentials, for providers that need none. |
A passthrough provider without an apikey is passthrough-only. Its models appear in /v1/models, but not in built-in chat. Chat requests have no client credential to forward. For setup instructions, including subscription-plan OAuth tokens, refer to set up passthrough mode.
Custom headers
Some providers require additional headers beyond the standard authorization field. Use add_headers on the provider to include custom headers in every request Aperture sends to that provider. Each entry is a string in "Header-Name: value" format:
{
"providers": {
"example-provider": {
"baseurl": "https://api.example.com",
"apikey": "<your-key>",
"authorization": "bearer",
"models": ["model-name"],
"add_headers": [
"Custom-Header: value"
]
}
}
}
Cost basis
Aperture estimates the dollar cost of every LLM request. Aperture uses these estimates to deduct request costs from quota balances, populate hook metadata, and show per-model pricing in the Aperture dashboard.
Aperture auto-infers pricing in two steps. It first checks the baseurl host against known gateway hosts. openrouter.ai maps to openrouter, and ai-gateway.vercel.sh maps to vercel. If the host does not match, Aperture falls back to the provider's compatibility flags. For example, anthropic_messages maps to Anthropic pricing.
Set cost_basis explicitly for a regional price source, such as bedrock-eu or azure-eu, or for a custom gateway host.
Use vertex for Gemini Enterprise Agent Platform and azure for both Microsoft Foundry provider types. Generic and self-hosted providers have no dedicated pricing source. With default Chat Completions compatibility, they fall back to openai. Use a model cost map when their model names are absent from that pricing source.
cost_basis value | Pricing source |
|---|---|
anthropic | Anthropic API list prices |
openai | OpenAI API list prices |
google | Google Gemini API list prices |
bedrock | AWS Bedrock pricing (US rates, default) |
bedrock-us | AWS Bedrock US-region pricing |
bedrock-eu | AWS Bedrock EU-region pricing |
bedrock-ap | AWS Bedrock AP-region pricing (uses US rates) |
vertex | Gemini Enterprise Agent Platform pricing |
azure | Azure OpenAI standard pricing |
azure-eu | Azure OpenAI EU-region pricing |
openrouter | OpenRouter pricing |
vercel | Vercel AI Gateway pricing |
To disable auto-inference globally, set auto_cost_basis to false at the top level of the configuration.
{
"auto_cost_basis": false,
"providers": {
"anthropic": {
"cost_basis": "anthropic"
}
}
}
When auto_cost_basis is false, Aperture estimates token costs only for providers with an explicit cost_basis. Costs reported directly by the upstream gateway remain available.
Model cost map
If a model is missing from the pricing database, use model_cost_map to map its name to a known model:
{
"providers": {
"anthropic": {
"cost_basis": "anthropic",
"model_cost_map": [
{"match": "claude-opus-5-*", "as": "claude-opus-4-8"},
{"match": "claude-*-preview*", "as": "claude-sonnet-4-6", "adjustment": 1.1}
]
}
}
}
This example prices claude-opus-5-* models like claude-opus-4-8. It prices preview models like claude-sonnet-4-6 with a 10% markup.
Each entry accepts the following fields:
| Field | Type | Default | Description |
|---|---|---|---|
match | string | (required) | Glob pattern against the model name. Uses Go's path.Match syntax, where * matches any sequence of non-separator characters and ? matches a single character. |
as | string | (required) | Replacement model name for the pricing lookup. |
adjustment | float | 1.0 | Price multiplier. A value of 1.5 marks up 50%. |
Aperture uses the first matching entry.
Related
- For the complete configuration schema, refer to the Aperture configuration reference.
- For step-by-step provider setup instructions, refer to the set up LLM providers guides.
- For instructions on configuring coding agents to connect through Aperture, refer to the set up LLM clients guides.
- For automated client configuration, refer to the Aperture CLI.
- For connection and request failures, refer to Troubleshooting Aperture.