Create a project key
Open Projects and keys. Create a project or select an existing one, issue a key and copy it when it appears. Keep the key in a secret store and expose it to your client as ANYLLM_API_KEY. Each key belongs to one project. The organization shares a RUB wallet across its projects. Project and key budgets control how much each can spend.
Check the connection
curl --fail-with-body https://api.anyllm.space/v1/models \
-H "Authorization: Bearer $ANYLLM_API_KEY"This returns the model IDs registered with the gateway. Choose demo-text to check authentication and the request history with a free sample response.
Send one request
curl -i https://api.anyllm.space/v1/chat/completions \
-H "Authorization: Bearer $ANYLLM_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: demo-quickstart-01' \
-H 'X-Client-Reference: first-demo' \
-d '{"model":"demo-text","messages":[{"role":"user","content":"Hello"}],"max_tokens":32}'Save the X-Request-Id response header. For a retry of this same operation, keep the same idempotency key and body. For a different prompt, choose a new idempotency key.
Use an SDK
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.anyllm.space/v1", api_key=os.environ["ANYLLM_API_KEY"])
reply = client.chat.completions.create(model="demo-text", messages=[{"role": "user", "content": "Hello"}], max_tokens=32, extra_headers={"Idempotency-Key": "demo-python-01"})
print(reply.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.anyllm.space/v1", apiKey: process.env.ANYLLM_API_KEY });
const reply = await client.chat.completions.create({ model: "demo-text", messages: [{ role: "user", content: "Hello" }], max_tokens: 32 }, { headers: { "Idempotency-Key": "demo-ts-01" } });
console.log(reply.choices[0].message.content);Verify the outcome
Open Request history, find the saved ID and inspect the charge. The demo costs zero RUB. Compare GET /v1/balance before and after if you need to verify the organization wallet. For a live request, select a configured model in the catalog and set a per-request cap. Cost caps and retries.