lowerinference
Docs

The API.

Lower Inference speaks the OpenAI Chat Completions API. If your code works with OpenAI, it works here.

Quickstart

Create a key in the dashboard, add credit, then:

from openai import OpenAI

client = OpenAI(base_url="http://lower-api-sby4ea-8c5733-51-81-83-61.sslip.io/v1", api_key="li_live_…")
reply = client.chat.completions.create(
    model="anthropic/claude-opus-5.5",
    messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)

Authentication

Send your key as a bearer token: Authorization: Bearer li_live_…. Keys start with li_live_. We store only a hash; if you lose one, revoke it and make another.

Chat completions

POST http://lower-api-sby4ea-8c5733-51-81-83-61.sslip.io/v1/chat/completions. Supported fields: model, messages (text and image parts), stream, max_tokens / max_completion_tokens, tools, tool_choice, parallel_tool_calls, response_format, temperature, top_p, stop, seed, reasoning_effort, and the penalties. Other fields are ignored. n must be 1.

Model ids are vendor/model as on the models page; the bare name (claude-opus-5.5) works too. Every response includes usage.cost: what that request cost you, in USD.

Streaming

Set stream: true for server-sent events in the OpenAI format. The last chunk before [DONE] carries usage with the cost. Reasoning models can be silent for a while before the first token; we send : keepalive comments every 15 seconds so proxies don't cut the connection. Clients ignore them.

Prompt caching

Cached prompt tokens are billed at the seller's cache price, which is much lower. To get the most from it, keep the start of your prompt stable and send the same X-Session-Id header (or session_id field) on every turn of a conversation: that keeps the conversation on the seller that already has it cached. Without one, we derive an id from the system prompt and first message. For Claude and Gemini models we add cache breakpoints for you unless you set your own cache_control.

Models

GET http://lower-api-sby4ea-8c5733-51-81-83-61.sslip.io/v1/models lists every model with its prices (no key needed). pricing.input / output are typical prices and max_input / max_output the most a reply can cost, in USD per 1M tokens.

Billing

Prepaid. Top up by card in the dashboard; each request is charged when it finishes, at what it really cost. GET http://lower-api-sby4ea-8c5733-51-81-83-61.sslip.io/v1/balance returns your balance. A request is capped so it can't run your balance below zero: if your balance only covers part of a long reply, max_tokens is lowered to fit and the reply ends with finish_reason: "length".

Errors

Errors use the OpenAI shape: { "error": { "message", "type", "code" } }. You're never charged for a request that fails before its first token.

  • 400 invalid_request: the request is malformed. Fix it before retrying.
  • 401 invalid_api_key: missing, wrong or revoked key.
  • 402 insufficient_balance: add credit.
  • 404 model_not_found: check the id against /models.
  • 429 model_busy or too_many_requests: retry after a short wait.
  • 502 upstream_unavailable, 503 temporarily_unavailable: retry with backoff.

Limits

Up to 16 requests in flight per account. Ask us if you need more.