Native provider routes

Use each provider's own API and SDK through ACOG, byte for byte: Anthropic, OpenAI, Vertex AI, Bedrock, Azure OpenAI and custom endpoints.

3 min read Updated View as Markdown Report a problem

The compatible endpoints translate between API shapes. The native routes do not: each forwards your request to one provider in that provider’s own format, with your connection’s credentials in place of the gateway key. Use them when you need a provider feature the compatible endpoints do not cover (token counting, Message Batches, the OpenAI Responses API, Bedrock’s Converse API), or to keep existing provider-SDK code unchanged apart from its base URL.

Routes

RouteForwards toBase URL for the provider’s SDK
/anthropic/…Your Direct Anthropic connectionhttps://gateway.acog.tessarac.com/anthropic
/openai/…Your Direct OpenAI connectionhttps://gateway.acog.tessarac.com/openai/v1
/vertex/…Your Vertex AI connection for the model in the pathhttps://gateway.acog.tessarac.com/vertex
/bedrock/…Your Bedrock connectionhttps://gateway.acog.tessarac.com/bedrock
/azure/…Your Azure OpenAI connectionhttps://gateway.acog.tessarac.com/azure
/custom/…Your custom connectionhttps://gateway.acog.tessarac.com/custom

The path after the prefix is the provider’s own path. A request to a route with no matching connection is refused with 409 connection_not_configured.

Authentication

Each route reads the gateway key from the header that provider’s SDK already sends, so you only swap the key:

RouteHeader
/anthropicx-api-key: acog_… (a bearer token is not read on this route)
/openai, /vertex, /customAuthorization: Bearer acog_…
/azureapi-key: acog_…
/bedrockAn AWS Signature Version 4 signature made with an issued ACOG Bedrock credential. See AWS Bedrock.

Every route also accepts x-acog-key: acog_….

Examples

Anthropic SDK, including token counting and Message Batches

import os
from anthropic import Anthropic

client = Anthropic(
    base_url="https://gateway.acog.tessarac.com/anthropic",
    api_key=os.environ["ACOG_API_KEY"],  # sent as x-api-key, which this route reads
)

count = client.messages.count_tokens(
    model="claude-haiku-4-5",
    messages=[{"role": "user", "content": "Hello"}],
)

batch = client.messages.batches.create(
    requests=[{
        "custom_id": "first",
        "params": {"model": "claude-haiku-4-5", "max_tokens": 64,
                   "messages": [{"role": "user", "content": "Hello"}]},
    }]
)

OpenAI SDK, Responses API

import os
from openai import OpenAI

client = OpenAI(base_url="https://gateway.acog.tessarac.com/openai/v1", api_key=os.environ["ACOG_API_KEY"])
response = client.responses.create(model="gpt-4.1-mini", input="Hello")

Vertex AI, Gemini generateContent

curl -s "https://gateway.acog.tessarac.com/vertex/v1/projects/my-project/locations/us-central1/publishers/google/models/gemini-3.1-flash-lite:generateContent" \
  -H "Authorization: Bearer $ACOG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contents": [{"role": "user", "parts": [{"text": "Hello"}]}]}'

Azure OpenAI SDK

import os
from openai import AzureOpenAI

client = AzureOpenAI(
    base_url="https://gateway.acog.tessarac.com/azure/openai",
    api_key=os.environ["ACOG_API_KEY"],
    api_version="2024-10-21",
)
completion = client.chat.completions.create(
    model="gpt-4o-mini",  # the deployment name
    messages=[{"role": "user", "content": "Hello"}],
)

What ACOG does on a native route

Native routes
Request bodyForwarded as sent, including provider-only fields. Only provider prompt-cache markers, prompt cleanup and data loss prevention masking can change it.
Provider headers (anthropic-version, anthropic-beta, your own tracing headers)Forwarded
Your gateway key and any provider credential you sentRemoved; the connection’s credentials are used
ResponseReturned as the provider sent it, including errors
Model access rules, budgets, rate limitsApplied
Data loss prevention and prompt injection screeningApplied to request bodies ACOG can read
Response cacheIdentical non-streaming requests are answered from cache
Provider prompt cachingAdded on Direct Anthropic and OpenAI requests
Translation, auto mode, failover, x-acog-batchNot available. Use the compatible endpoints for these.
x-acog-resolved-model headerNot set; the provider’s response names the model

Model access on native routes

ACOG needs to know the model to apply model access rules. When a rule restricts models and ACOG cannot tell the model from the request (an opaque or multipart body), the request is refused with 403 model_unverifiable.

Vertex AI locations

A native Vertex request goes to the location configured for its model on your connection (its model region, or the connection’s region), whatever location the URL names. It is not retried in other locations. See Google Vertex AI.