Loading Inferum…
Loading Inferum…
Keep your SDK. Change your endpoint. Connect your agents and applications to Inferum.
Create an account, claim 10 million free tokens, and create an API key. Then configure your OpenAI-compatible client.
https://inferum.ai/v1import os
from openai import OpenAI
client = OpenAI(
base_url="https://inferum.ai/v1",
api_key=os.environ["INFERUM_API_KEY"]
)
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V4-Flash-0731",
messages=[
{"role": "user", "content": "Hello from Inferum"}
]
)
print(response.choices[0].message.content)Send your API key as a Bearer token. Keep keys in server-side environment variables and out of browser code. The full key is shown only once when you create it.
Authorization: Bearer <INFERUM_API_KEY>The chat completions interface follows OpenAI-compatible request and response shapes. Point your existing client at the Inferum base URL and use a model identifier from the catalogue. Text conversations and streaming are supported. Tool parameters are forwarded; individual models may reject them.
pip install openaiSend a conversation as a list of role and content pairs. Read the generated response from choices[0].message.content.
POST /v1/chat/completionsFor supported models, set stream to true to receive server-sent completion chunks as tokens are generated.
stream = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V4-Flash-0731",
messages=[{"role": "user", "content": "Hello"}],
stream=True
)
for chunk in stream:
if chunk.choices:
print(chunk.choices[0].delta.content or "", end="")Describe tools with a JSON schema. Your application executes tool calls and returns their results to the conversation. Availability will depend on the selected model.
{
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the weather for a city",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string"
}
},
"required": [
"city"
]
}
}
}
]
}Embeddings are not supported by the current inference API. Image, audio, and batch endpoints are also unavailable.
Handle non-success responses and retain the request identifier when one is supplied.
400Invalid requestCheck model ID and payload.401Authentication failedCheck or rotate your API key.402Insufficient balanceAdd balance before retrying.429Rate limit exceededRespect Retry-After and back off.503Capacity unavailableRetry with exponential backoff.Inferum adds no requests-per-minute, concurrency, or output-token caps. Your requested output maximum is forwarded unchanged; when omitted, the model default applies. Model context, provider capacity, hosting constraints and available balance still apply. A token budget is reserved and unused tokens are released after confirmed usage. Interrupted requests remain pending until usage can be verified. Check request history before retrying; an Idempotency-Key prevents duplicate submissions.