Your first call, in two minutes.
LegionEdge speaks the OpenAI chat-completions API. If your code already talks to any OpenAI-compatible provider, changing the base URL and the key is the whole integration.
Quickstart
1Create a project API key
Keys live under a project, in Gateway → Keys. Create one, then copy it — the full secret is shown once, and the console only keeps its prefix afterwards. Every key carries the project it was minted in, which is how usage and billing get attributed.
2Put it in your environment
Nothing below hard-codes the key, so the same commands are safe to paste into a shared terminal or a script you commit.
export LEGIONEDGE_API_KEY="lek_live_…"3Send a chat completion
One POST to /chat/completions with a model id and a list of messages. This runs on the shared pool — there is no GPU to start and nothing to wait for.
curl https://inference.legionedge.ai/v1/chat/completions \
-H "Authorization: Bearer $LEGIONEDGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "qwen3-4b-instruct", "messages": [{"role": "user", "content": "Hello!"}]}'You get back the usual OpenAI response envelope: a choices[0].message.content with the reply, and a usage block whose token counts are exactly what the request is billed on.
4Or point an SDK at it
The official OpenAI clients work unmodified — only base_url changes.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://inference.legionedge.ai/v1",
api_key=os.environ["LEGIONEDGE_API_KEY"],
)
response = client.chat.completions.create(
model="qwen3-4b-instruct",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)What you need to know
- Base URL
- https://inference.legionedge.ai/v1
- Authentication
Authorization: Bearer <key>. The key identifies your project; the hostname is the same for everyone.- Listing models
GET /v1/modelsreturns every id your key can call, shared and dedicated alike.- Billing
- Per token on the shared pool, per GPU-hour for dedicated endpoints. See the rates.