Custom endpoints
Add your own endpoint to an app's allowed providers, such as an Azure OpenAI deployment or a self-hosted server. HTTPS and public addresses only, in OpenAI or Anthropic format.
If a provider is not in the built-in list, add it as your own endpoint. Typical cases are an Azure OpenAI deployment and a self-hosted server that speaks the OpenAI or Anthropic API. An app can have up to 20 entries, built-in and custom together.
Add an endpoint
Open the setting
In the dashboard, open the app and go to App settings, then Allowed providers. Under Your own endpoints, choose Add an endpoint.
Fill in the endpoint
| Field | What to enter |
|---|---|
| Name | The name you will use in the proxy URL or in x-tawa-upstream. Lowercase letters, numbers and hyphens, up to 32 characters. The built-in names and auto are reserved. |
| Base URL | The provider's base URL, for example https://my-resource.openai.azure.com. HTTPS only, on a public host name. It can include a path prefix. |
| Format | OpenAI for Chat Completions and Responses, or Anthropic for Messages. |
| Key header | The header your provider expects the key in: authorization, x-api-key or api-key. |
For an OpenAI-format endpoint that routes a model to several providers, you can also set provider limits. See OpenRouter provider limits.
Save the card
Nothing changes until you save the Allowed providers card. A change reaches the proxy in about 20 seconds.
How requests reach it
The proxy removes the token and the endpoint name from the path, then appends
the rest to your base URL. The query string is forwarded too, so an
api-version parameter reaches the provider.
With an endpoint named my-llm and the base URL https://llm.example.com/openai:
https://proxy.tawaguard.com/<token>/my-llm/v1/chat/completions?api-version=2025-01-01
goes to
https://llm.example.com/openai/v1/chat/completions?api-version=2025-01-01The proxy forwards your own key header untouched. Send the key in the header your provider expects.
For an endpoint that reads the key from Authorization, the SDK's api_key
does the job.
import os
from openai import OpenAI
client = OpenAI(
base_url=f"https://proxy.tawaguard.com/{os.environ['TAWA_PROXY_TOKEN']}/my-llm/v1",
api_key=os.environ["MY_LLM_API_KEY"],
)
reply = client.chat.completions.create(
model="<your model>",
messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: `https://proxy.tawaguard.com/${process.env.TAWA_PROXY_TOKEN}/my-llm/v1`,
apiKey: process.env.MY_LLM_API_KEY,
});
const reply = await client.chat.completions.create({
model: "<your model>",
messages: [{ role: "user", content: "Hello" }],
});
console.log(reply.choices[0].message.content);An endpoint that reads the key from another header, such as api-key on an
Azure OpenAI deployment, gets that header exactly as you send it.
curl "https://proxy.tawaguard.com/$TAWA_PROXY_TOKEN/azure-eu/v1/chat/completions?api-version=2025-01-01" \
-H "api-key: $AZURE_OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "<your deployment>", "messages": [{"role": "user", "content": "Hello"}]}'What to know
- The base URL must use HTTPS and a public address. An address in a private, loopback, link-local or similar range is rejected when you save, and again on every request.
- If the name resolves to a private address when a request arrives, the proxy returns
502withtawa_upstream_blockedand sends nothing. If it cannot be resolved, the response is502withtawa_upstream_unreachable. - Redirects from your endpoint are not followed.
- One entry serves only the paths of its format. An OpenAI-format endpoint serves
/chat/completionsand/responses. An Anthropic-format endpoint serves/messages. - Your key passes through to your endpoint. Tawa Guard does not store it.
- The proxy does not change the model or deployment name in your request.
See Error codes and Routing rules.
OpenRouter provider limits
Limit which hosting providers OpenRouter may use for an app. Allow a list, block a list, or require providers that do not collect or train on prompts. A client can narrow these limits but never widen them.
Settings overview
Where each hosted proxy setting lives, whether it belongs to the app or to a token, and its default.