Skip to main content

Create endpoints and keys

An endpoint is what you paste into your apps: a base URL and a key. It can also have its own routing: the models that answer its calls. To change those models later, you change the endpoint. Your apps stay the same.

Fig. 1 · three apps, two endpoints, your vendors
your appsendpoints · in Proxiumyour vendorssupport-botinbox-workerreport-writerchat-cheapstandard → smalllong-formstandard → largeGroqyour Groq keyOpenAIyour OpenAI keyeach app sends x-proxium-source, so its spend stays separatesupport-botinbox-workerchat-cheapstandard → small modelGroqyour Groq keyreport-writerlong-formstandard → large modelOpenAIyour OpenAI keyamber: an endpoint and its route

One endpoint can serve all your apps. Each app sends its own name in x-proxium-source, so its spend stays separate. Make a second endpoint only when a group of apps needs different models.

Create an endpoint​

  1. In the console, open Endpoints, and select New endpoint.
  2. In Name it after the app, type a name, for example chat-cheap. Per-key burn on Overview shows this name.
  3. Optional: give the endpoint its own models. See Give the endpoint its own models.
  4. Select Create endpoint.
warning

Copy the key before you close the panel. The console shows it one time only.

  1. The panel chat-cheap is live shows the base URL and the key. Copy both.
Terminal
export PROXIUM_KEY="paste-the-key-here"

The base URL is https://proxium.tech/v1 for every endpoint. Only the key is different.

Use the endpoint in your app​

Send the key, and send a tier name in model, for example standard:

app.py
import os
from openai import OpenAI

client = OpenAI(
base_url="https://proxium.tech/v1",
api_key=os.environ["PROXIUM_KEY"],
default_headers={"x-proxium-source": "support-bot"},
)

response = client.chat.completions.create(
model="standard",
messages=[{"role": "user", "content": "Summarise this ticket in one line."}],
)

The routing of the endpoint applies to a tier name. If you send a model id, such as t.acme.groq/llama-3.3-70b-versatile, Proxium calls that model first, whatever the endpoint routing says.

Give the endpoint its own models​

Without its own routing, an endpoint uses the chains of the project. To give it its own:

  1. Under Route a request type, select the type: Text, Embeddings, Images, Speech or Video.
  2. In the box of that type, select the tier that the rule applies to. The default is standard.
  3. Under Pick the model to try first, select a model.
  4. Under Pick a fallback, add each next model, in order.

You can do this when you create the endpoint, or later. To change it later, select Routing on the row of the endpoint, change the rules, and select Save routing.

You doResult
Add a rule for Text › standardCalls of this endpoint with model: "standard" use your chain
Add no rule for a typeCalls of that type use the chain of the project
Remove every ruleThe endpoint uses the chains of the project again
note

A rule for one application wins over the rule of an endpoint. See Know which chain wins.

When to make a second endpoint​

Your appsEndpoints
Five apps that use the same modelsOne endpoint. Each app sends its own x-proxium-source
A chatbot on a small model, and a summariser on a large modelTwo endpoints, each with its own routing
One app that must stop at once, if its key leaksIts own endpoint, so that you can revoke that key only

Endpoints and keys​

The Keys screen makes a plain virtual key, without routing of its own.

EndpointsKeys
GivesA base URL, a key and its own routingA key
RoutingIts own rules, or the project chainsThe project chains
Best forThe apps that you run in productionA quick test, a script

Both show the key one time only. Both appear in Per-key burn with their name.

Revoke an endpoint​

Select Revoke on the row, and confirm. Each app that uses the key gets 401 invalid_key at once. Proxium also removes the routing of the endpoint.

An endpoint that passed its expiry time shows expired · every call returns 401.

Limit an endpoint​

The key of an endpoint is on Keys too. Set its calls, rate and dollar limits there. See Set budgets and limits.