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.
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
- In the console, open Endpoints, and select New endpoint.
- In Name it after the app, type a name, for example
chat-cheap. Per-key burn on Overview shows this name. - Optional: give the endpoint its own models. See Give the endpoint its own models.
- Select Create endpoint.
Copy the key before you close the panel. The console shows it one time only.
- The panel chat-cheap is live shows the base URL and the key. Copy both.
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:
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:
- Under Route a request type, select the type: Text, Embeddings, Images, Speech or Video.
- In the box of that type, select the tier that the rule applies to. The default is
standard. - Under Pick the model to try first, select a model.
- 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 do | Result |
|---|---|
Add a rule for Text › standard | Calls of this endpoint with model: "standard" use your chain |
| Add no rule for a type | Calls of that type use the chain of the project |
| Remove every rule | The endpoint uses the chains of the project again |
A rule for one application wins over the rule of an endpoint. See Know which chain wins.
When to make a second endpoint
| Your apps | Endpoints |
|---|---|
| Five apps that use the same models | One endpoint. Each app sends its own x-proxium-source |
| A chatbot on a small model, and a summariser on a large model | Two endpoints, each with its own routing |
| One app that must stop at once, if its key leaks | Its 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.
| Endpoints | Keys | |
|---|---|---|
| Gives | A base URL, a key and its own routing | A key |
| Routing | Its own rules, or the project chains | The project chains |
| Best for | The apps that you run in production | A 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.
Related pages
- Route requests to models: tiers, chains and fallback.
- Track spend: the spend of each key and each app.