Provider configuration

Last validated:

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.

FlagTypeDefaultDescription
openai_chatbooleantrue unless another flag is enabledSupports /v1/chat/completions. Set explicitly to retain or disable it alongside other flags.
openai_responsesbooleanfalseSupports /v1/responses
anthropic_messagesbooleanfalseSupports /v1/messages
gemini_generate_contentbooleanfalseSupports the direct Gemini API (generativelanguage.googleapis.com)
bedrock_model_invokebooleanfalseSupports Amazon Bedrock InvokeModel. Request format depends on the model family.
google_generate_contentbooleanfalseSupports Gemini Enterprise Agent Platform Gemini format (aiplatform.googleapis.com)
google_raw_predictbooleanfalseSupports Gemini Enterprise Agent Platform raw predict for Anthropic models
bedrock_conversebooleanfalseSupports 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.

FieldTypeDefaultDescription
descriptionstring""Human-readable description of the provider.
preferenceinteger0Routing priority. Higher values are preferred when multiple providers serve the same model.
disabledbooleanfalseExcludes 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.

ValueHeader formatUsed by
bearerAuthorization: Bearer <key>OpenAI and most providers
x-api-keyx-api-key: <key>Anthropic
x-goog-api-keyx-goog-api-key: <key>Google Gemini
hecAuthorization: Splunk <key>Splunk HTTP Event Collector
cf-aig-authorizationcf-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.

ValueBehavior
"" (default)Inject the configured apikey on every request.
overrideExplicit form of the default. Inject the configured apikey. Requires a non-empty apikey, or the configuration fails to save.
passthroughForward 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.
noneStrip 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 valuePricing source
anthropicAnthropic API list prices
openaiOpenAI API list prices
googleGoogle Gemini API list prices
bedrockAWS Bedrock pricing (US rates, default)
bedrock-usAWS Bedrock US-region pricing
bedrock-euAWS Bedrock EU-region pricing
bedrock-apAWS Bedrock AP-region pricing (uses US rates)
vertexGemini Enterprise Agent Platform pricing
azureAzure OpenAI standard pricing
azure-euAzure OpenAI EU-region pricing
openrouterOpenRouter pricing
vercelVercel 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:

FieldTypeDefaultDescription
matchstring(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.
asstring(required)Replacement model name for the pricing lookup.
adjustmentfloat1.0Price multiplier. A value of 1.5 marks up 50%.

Aperture uses the first matching entry.