Skip to main content

Use the Responses, embeddings, rerank and moderations APIs

Proxium serves four more OpenAI APIs with the same base URL and virtual key as chat:

RouteWhat it doesRouting typeStream
POST /v1/embeddingsTurns text into vectorsEmbeddingsNo
POST /v1/responsesThe OpenAI Responses APITextYes
POST /v1/rerankOrders documents by how well they match a queryTextNo
POST /v1/moderationsChecks text against a content policyTextNo

Proxium sends your request body to the same path at the vendor, for example <base URL of the vendor>/embeddings. It sends the answer of the vendor back without change.

Your appPOST /v1/embeddings
Proxiumchecks the key and the limits, picks the model
The vendorPOST <its base URL>/embeddings
Your appgets the answer of the vendor, unchanged
warning

The vendor must serve that path. For example, a Groq vendor serves chat. A rerank call that goes to it fails, and Proxium tries the next model of the chain.

Make embeddings​

  1. Add a vendor that serves embeddings, for example the OpenAI (embeddings) preset. See Add vendors and your own keys.
  2. Get the model id from GET /v1/models, for example t.acme.openai-embed/text-embedding-3-small.
  3. Send the id in model:
result = client.embeddings.create(
model="t.acme.openai-embed/text-embedding-3-small",
input=["The first text.", "The second text."],
)
print(len(result.data), len(result.data[0].embedding))

Proxium does not store or search the vectors. It records the tokens and the cost of the call.

To send a tier name in place of the id, set a chain for the tier embed in Routing › Embeddings routing.

Use the Responses API​

Send the call to a vendor that serves the Responses API, such as OpenAI. Set stream to true to get server-sent events.

response = client.responses.create(
model="t.acme.openai/gpt-4o-mini",
input="Write one sentence about queues.",
)
print(response.output_text)

Rerank and moderations​

Send the body that your vendor documents. Proxium needs only the model field:

Terminal
curl https://proxium.tech/v1/rerank \
-H "Authorization: Bearer $PROXIUM_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "t.acme.my-reranker/bge-reranker-v2-m3", "query": "refund policy", "documents": ["Refunds take 5 days.", "We ship worldwide."]}'

Here my-reranker is a server that you added with A server I run myself, with the request type Text.

What is the same as chat, and what is not​

Chat and MessagesThese four routes
Virtual key, ceilings, cost recordYesYes
Routing and failoverYesYes
Row in the Attempt logYesYes
Response cacheYesNo. Each call goes to a vendor
x-proxium-memory: recallAdds memoriesNo effect. /v1/responses keeps the call in memory as write
A call without model400 bad_json400 missing_model