Quickstart
In this quickstart, you send one request from your computer to a model, through Proxium. It takes five steps, in the console at proxium.tech/app and in your terminal.
You need:
- A Proxium account. Sign in at proxium.tech/app.
- An API key from a model vendor, such as OpenAI, Anthropic, Groq or Mistral. Providers lists every vendor.
curlandjqin your terminal.
1. Add a vendor
Proxium calls the vendor with your vendor key. To add the vendor, open Providers in the console and select Add a vendor.
- In What are you adding, select your vendor.
- Paste your vendor key into API key.
- Select Add and the name of the vendor, for example Add Groq.
The vendor shows in the Vendors table, with its list of models.
If the console shows One thing first after you sign in, type a name in Project name and select Create project. Then add the vendor.
2. Create an endpoint
An endpoint gives your app a base URL and a virtual key. Your vendor key stays in Proxium.
The console shows the key one time only. Copy it before you close the panel.
- Open Endpoints, and select New endpoint.
- In Name it after the app, type
quickstart. - Select Create endpoint.
- In the panel quickstart is live, select the copy button of the key.
- Save the key in your terminal:
export PROXIUM_KEY="paste-your-virtual-key-here"
3. Pick a model
Ask Proxium for the models that your project can use:
curl -s https://proxium.tech/v1/models \
-H "Authorization: Bearer $PROXIUM_KEY" | jq -r '.data[].id'
You see one line for each model of your vendor. A model id is the vendor of your project and a model name:
t.acme.groq/<model-a>
t.acme.groq/<model-b>
acme is your project. Save one id in your terminal:
export PROXIUM_MODEL="t.acme.groq/<model-a>"
The console shows the same models on Providers, in the row of your vendor. If the list is empty, do step 1 again.
4. Send a request
Send the request to https://proxium.tech/v1, with your virtual key:
- curl
- Python
- Node
curl https://proxium.tech/v1/chat/completions \
-H "Authorization: Bearer $PROXIUM_KEY" \
-H "Content-Type: application/json" \
-d "{\"model\": \"$PROXIUM_MODEL\", \"messages\": [{\"role\": \"user\", \"content\": \"Say hello in five words.\"}]}"
pip install openai
import os
from openai import OpenAI
client = OpenAI(
base_url="https://proxium.tech/v1",
api_key=os.environ["PROXIUM_KEY"],
)
response = client.chat.completions.create(
model=os.environ["PROXIUM_MODEL"],
messages=[{"role": "user", "content": "Say hello in five words."}],
)
print(response.choices[0].message.content)
python hello.py
npm install openai
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://proxium.tech/v1",
apiKey: process.env.PROXIUM_KEY,
});
const response = await client.chat.completions.create({
model: process.env.PROXIUM_MODEL,
messages: [{ role: "user", content: "Say hello in five words." }],
});
console.log(response.choices[0].message.content);
node hello.mjs
The Python and Node scripts print the reply of the model. curl prints the whole answer, which looks like this (shortened):
{
"object": "chat.completion",
"model": "<model-a>",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Hello there, nice to meet!" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 14, "completion_tokens": 7, "total_tokens": 21 }
}
The reply is in choices[0].message.content, and the token counts are in usage. Proxium prices the call from these counts.
5. See the request in the console
The console records each request. To see yours, open Requests in the console. Your request is the first row of the Attempt log:
| When | Model | Asked for | Try | Outcome | Took |
|---|---|---|---|---|---|
| … | t.acme.<vendor>/<model> | t.acme.<vendor>/<model> | 1 | success | … |
| Column | What it tells you |
|---|---|
| Model | The model that answered |
| Asked for | The model or tier in your request |
| Try | The number of the vendor call. 2 or more means that a call failed, and Proxium called the same model again or the next model |
| Outcome | success, error, timeout or circuit_open |
When calls come from more than one app, the log also has an App column. Your app sets its name with the x-proxium-source header.
The cost of the request shows on Overview, in Spent.
Next steps
- Use the OpenAI SDK: connect your app.
- Create endpoints and keys: give your apps their own models.
- Route requests to models: send a tier name in place of a model id, and set the order of fallback models.
- Track spend: see the cost of each app and each model.