InfrenisConsole

API documentation

OpenAI-compatible chat completions. Use any OpenAI SDK with a different base URL.

Quickstart

Create a key in the console, add credit, then call the API.

curl https://api.infrenis.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "qwen3.8-27b-uncensored", "messages": [{"role": "user", "content": "Hello"}]}'
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.infrenis.com/v1", apiKey: process.env.API_KEY });
const stream = await client.chat.completions.create({
  model: "qwen3.8-27b-uncensored",
  messages: [{ role: "user", content: "Write a haiku" }],
  stream: true,
  stream_options: { include_usage: true },
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");

Endpoints

POST /v1/chat/completionsChat completions, streaming and non-streaming.
GET /v1/modelsModel, limits, capabilities, deployment revision, prices.
GET /v1/creditsAvailable credit, balance, and held funds.
GET /v1/requests/{id}Status, token usage, and charge for one request (no prompt or output text).
GET /v1/usagePaginated usage for your organization (?limit=&cursor=).

Parameters

  • messages: system, user, assistant, tool roles. Text content only at launch.
  • max_tokens or max_completion_tokens (send one). Default 8,192; maximum shown in /v1/models.
  • Sampling: temperature, top_p, top_k, min_p, presence_penalty, frequency_penalty, repetition_penalty, stop, seed.
  • Tools: tools, tool_choice (auto, none, required, or a named function), parallel_tool_calls.
  • Structured output: response_format with json_object or json_schema.
  • Reasoning: on by default at the model's highest effort. reasoning_effort (or reasoning: {effort}) of low, medium, or high/xhigh (same thing: the model's top level); none or minimal, reasoning: {enabled: false}, or thinking: {type: "disabled"} turn it off. Reasoning text arrives in reasoning_content and is billed as output.
  • service_tier: "flex": half price, idle capacity only, may return 429.
  • Unknown fields are ignored. Engine-specific fields are never forwarded.

Billing rules

  • Charge = uncached prompt tokens × input rate + cached prompt tokens × cached rate + output tokens × output rate. Output includes reasoning.
  • Hold: before a request runs, its worst case (every prompt token uncached plus the full max_tokens) is held. Lower max_tokens if you get HTTP 402 with a small balance.
  • Cache: prompt caching is automatic and private to your organization. Only real cache hits get the cached rate.
  • Cancellation: closing the connection stops generation. You pay for tokens generated until then. If the stream stops before the engine reports the cached/uncached split, all prompt tokens are billed at the cached rate.
  • Faults: engine failures and invalid model output (for example repetition loops, empty answers, broken tool calls) end with an error and are not billed.
  • The final usage chunk and non-streaming responses include usage.cost in USD.

Streaming

Server-sent events in OpenAI format, ending with data: [DONE]. Long prompts can take time before the first token; the stream sends : keepalive comments meanwhile. A failure after streaming started arrives as a chunk with finish_reason: "error" and an error object.

Errors

StatusCodeMeaning
400invalid_request, context_length_exceededFix the request. Not billed.
401invalid_api_keyMissing, invalid, or revoked key.
402insufficient_creditsWorst-case cost exceeds available credit.
403account_frozenContact support.
409duplicate_requestThe Idempotency-Key was already used; see x-request-id.
429rate_limited, concurrency_limit, capacity_exhaustedRetry after Retry-After seconds.
502invalid_model_output, engine_errorNot billed. Safe to retry.
503no_worker_available, service_pausedTemporary. Retry later.

Retries and idempotency

Send Idempotency-Key: <unique> to make retries safe: a repeated key returns HTTP 409 with the original x-request-id instead of running again. Every response carries x-request-id.

Limits

  • Context up to the value in /v1/models. Requests above 64K tokens share a small long-context pool.
  • Request body up to 32 MiB.
  • Per-key request rate and per-organization concurrency limits apply; contact support to raise them.

Data handling

Prompts and outputs are not logged or stored. During processing they exist in GPU and host memory, and reusable prompt prefixes stay in a private, per-organization cache until evicted (typically minutes). We store request metadata for billing: ids, timestamps, token counts, and charges.