← Knowledge base

Call the API from your code

ElephantPool speaks the OpenAI API. Change the base URL, keep your SDK, pick a model id, pay per token with a prepaid balance and a spend cap.

The gateway implements the OpenAI chat completions API. If your code already talks to OpenAI, you change one line.

Two minutes

curl https://app.elephantpool.ai/api/gateway/v1/chat/completions \
  -H "Authorization: Bearer $ELEPHANTPOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"qwen3.8-27b","messages":[{"role":"user","content":"Hello"}]}'

With the official Python SDK:

from openai import OpenAI

client = OpenAI(
    base_url="https://app.elephantpool.ai/api/gateway/v1",
    api_key=os.environ["ELEPHANTPOOL_API_KEY"],
)
client.chat.completions.create(model="qwen3.8-27b", messages=[...])

Which model id?

GET /v1/models returns the catalogue with prices, context and capabilities under an x-elephant key; the same list is on the models page. Streaming works as you'd expect ("stream": true, server-sent events).

What it costs

Per million tokens, in euros, listed per model — input and output priced separately. You top up a prepaid balance; there is no subscription and no minimum. Every key carries a spend cap (€20 by default) so a runaway loop cannot empty your balance, and usage is broken down per key in the dashboard.

What's different from a hyperscaler

  • Open weights only — you can run the same model yourself, so you are never locked in.
  • Prompts are not retained and not trained on. See security and privacy.
  • The compute is community GPUs across Europe, which is why the price is what it is.