Inferway
Skip to content
Start by intent

Choose the job you need to finish right now.

The docs are organized around the user journey rather than product internals: first request, migration, debugging, and production readiness. Reference details are still below when you need them.

Happy path

From empty shell to verified request.

Follow these steps in order. Each step answers the next question a new developer has: where do I sign up, where is my key, what do I run, and how do I know it worked?

  1. 1. Create an account. No credit card, no invite — sign-up is open at inferway.ai.
  2. 2. Copy a key. A Default key is created on your first visit to the Console and shown once. Rotate or add keys anytime under API keys.
  3. 3. Run the request. Set $INFERWAY_API_KEY and run the streaming command below.
  4. 4. Verify it worked. Check status, latency, tokens, and model in Console → Requests.

First request

Zero-dependency smoke test against the chat completions endpoint. Set $INFERWAY_API_KEY to a inferway_live_… key, paste, and run. Tokens print as they arrive.

One-command streaming quickstartbash
export INFERWAY_API_KEY="inferway_live_..."

curl https://api.inferway.ai/v1/chat/completions \
  -H "Authorization: Bearer $INFERWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "inferway/qwen3-8-27b",
    "stream": true,
    "messages": [{"role": "user", "content": "Say hello in one short sentence."}]
  }'
curl https://api.inferway.ai/v1/chat/completions \
  -H "Authorization: Bearer $INFERWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "inferway/qwen3-8-27b",
    "stream": true,
    "messages": [{"role": "user", "content": "Say hello in one short sentence."}]
  }'
Streaming

Non-streaming requests pass through a CDN with roughly a 100-second first-byte timeout, so any long output must set stream=true. Non-streaming is fine for short completions.

That’s it

You are using the same Chat Completions interface you already know.

Only three values change when you move an existing OpenAI-compatible integration over.

  • Base URLhttps://api.inferway.ai/v1
  • API key$INFERWAY_API_KEY
  • Modelinferway/qwen3-8-27b
Copy setup for your AI assistantInstalls the SDK, sets base_url and the model id, reads the key from an environment variable, writes a streaming smoke test. The prompt carries a placeholder, never a real key.

Response shape

Streamed chunks are OpenAI-compatible: concatenate choices[0].delta.content as chunks arrive; the final chunk carries usage.

Example streamed chunkjson
data: {
  "id": "chatcmpl_...",
  "object": "chat.completion.chunk",
  "model": "inferway/qwen3-8-27b",
  "choices": [
    {
      "index": 0,
      "delta": { "role": "assistant", "content": "Hello" },
      "finish_reason": null
    }
  ]
}

data: [DONE]

If the first request does not work

Most first-run issues are configuration issues. Check these before changing application code.

SymptomLikely causeFast fix
401The key is missing, revoked, copied incorrectly, or not exported in this shell.Re-copy the key from Console → API keys, then run echo $INFERWAY_API_KEY locally before retrying.
404The client is pointed at the wrong base URL or duplicated the /v1 path.Use https://api.inferway.ai/v1 as the base URL and call /chat/completions once.
429The request hit the free-use or keyless rate limit.Read Retry-After, back off, and check the rate-limit table below.
504 / timeoutA long non-streaming output hit the roughly 100-second CDN first-byte timeout.Set stream=true on the request.
Drop-in config

Already using an OpenAI client?

Keep your existing request shape. Point the client at Inferway, reuse your server-side key, and pin the published model id.

OpenAI-compatible environment variablesbash
# For OpenAI-compatible clients that read OpenAI env vars
export OPENAI_API_KEY="$INFERWAY_API_KEY"
export OPENAI_BASE_URL="https://api.inferway.ai/v1"
export INFERWAY_MODEL="inferway/qwen3-8-27b"

Chat completions — Python

The official OpenAI Python SDK works against any OpenAI-compatible base URL. Swap the base URL, keep your existing key. This non-streaming shape is fine for short completions; anything long must stream.

Pythonpython
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.inferway.ai/v1",
    api_key=os.environ["INFERWAY_API_KEY"],
)

resp = client.chat.completions.create(
    model="inferway/qwen3-8-27b",
    messages=[{"role": "user", "content": "Say hello in one short sentence."}],
    max_tokens=64,
)

print(resp.choices[0].message.content)

Install the SDK (optional)

The first cURL request needs no dependencies. Install the OpenAI SDK only when you are ready to wire the integration into an application.

Installbash
# Python
pip install openai

# TypeScript / Node.js
npm install openai

MCP (Model Context Protocol)

Live

The MCP endpoint is live. Point an MCP-capable client at the server URL below and authenticate with the same API key; tools are served over the standard protocol, and the same zero-retention rules apply.

MCP server entryjson
{
  "mcpServers": {
    "inferway": {
      "url": "https://api.inferway.ai/v1/mcp/sse",
      "headers": {
        "Authorization": "Bearer $INFERWAY_API_KEY"
      }
    }
  }
}

Production checklist

  • Keep keys server-side. Never ship inferway_live_… keys in browsers, mobile apps, or public repos.
  • Stream long outputs. Anything that can exceed the CDN first-byte window must set stream=true.
  • Budget max tokens. Enforce a per-route max_tokens ceiling so costs and latency stay predictable.
  • Monitor metadata. Track status, latency, token counts, and model; never log prompt or completion bodies if you need zero-retention semantics end to end.
Transparency checklist

Before you put traffic behind Inferway, start with the hub, then drill into live status and raw reports.

Endpoint reference

Inferway keeps the OpenAI-compatible path small and predictable, then exposes account, billing, usage, and agent operations as separate first-party endpoints.

OpenAI-compatible API/v1/chat/completions

Use this for chat, tools, JSON mode, and streaming with OpenAI SDKs.

Console API/v1/keys · /v1/billing · /v1/usage · /v1/requests

Use this for server-side key, wallet, usage, and request-metadata workflows.

EndpointMethodPurpose
/v1/chat/completionsPOSTOpenAI-compatible chat completions
/v1/modelsGETList published models with capability and pricing metadata
/v1/mcp/sse · /v1/mcp/messagesGET · POSTMCP server endpoint (live)
/v1/keysGET / POST / DELETEManage direct API keys
/v1/billingGETWallet summary and recent usage
/v1/billing/transactionsGETWallet ledger transactions
/v1/billing/checkoutPOSTCreate a Stripe Checkout top-up session
/v1/usageGETAggregated usage for a time window
/v1/requestsGETRequest metadata history (no content)
/healthGETGateway and backend health status
/v1/statsGETPublic status page payload

Models

Start with the published model below, then use /v1/models when your app needs to display capabilities, context window and pricing metadata dynamically.

FieldCurrent valueHow to use it
Recommended modelinferway/qwen3-8-27bUse as the default model in chat-completions calls.
Context window262,144Input token ceiling for a single request.
Max output32,768Output token ceiling for a single response.
PrecisionNVFP4The precision advertised is the precision served, with no downgrade under load.
All values read from the model catalog

Authentication

Authenticate every direct API request with a bearer token issued in the Console. Treat live keys as server-side secrets and rotate them if exposure is suspected.

Authentication headerhttp
Authorization: Bearer $INFERWAY_API_KEY
  • Live keys. Use inferway_live_… for production server workloads.
  • Test keys. Use inferway_test_… while integrating and validating billing flows.
  • Browser apps. Do not expose direct keys client-side; proxy requests through your backend.

Error codes

Inferway returns OpenAI-compatible error objects: {"error": { "type": "...", "message": "...", "code": "..." }}

HTTPtypeMeaningWhat to do
400invalid_requestMalformed request or invalid parametersCheck the request body
401invalid_authAPI key invalid, revoked, or session expiredRefresh your key or re-authenticate
402insufficient_balanceWallet + credit below the minimum thresholdTop up via Console → Billing
403content_policyContent policy violation or sanctioned regionDo not retry; review AUP/Terms
429rate_limitedFree-use or concurrency limit exceededBack off and retry (read Retry-After)
500internal_errorGateway internal errorRetry; contact support if persistent
502backend_unavailableInference backend is unreachableBack off and retry
503drainingGateway is draining for maintenanceRetry after the Retry-After interval
530upstream_downInference unavailable — usually a maintenance windowThe status page says what is affected and for how long

Rate limits and quotas

Every /v1/* inference response carries X-RateLimit-* headers. When a limit is hit the response is HTTP 429 with Retry-After and a rate_limited error object.

SubjectLimitWindow
Free and keyless use60per minute, per IP
Free and keyless use120per hour
Free and keyless use1,000per UTC day
Funded accountsAccount limitsFree caps no longer apply — visible in the console
  • X-RateLimit-Limit. The quota of the current RPM window.
  • X-RateLimit-Remaining. Requests remaining in the current window.
  • X-RateLimit-Reset. Unix timestamp when the current window resets.
  • Retry-After. Seconds to wait before retrying after a 429.

Operational limits

  • Concurrency ceiling. — being measured; published with its test conditions.
  • Data retention. Zero for content; metadata only, for billing and reliability.
All limits read from the gateway configuration

OpenAI compatibility

The matrix below reflects how the gateway actually handles each parameter today — not how we wish it handled it.

ParameterStatusNotes
modelSupportedRewritten to the backend model ID before proxying.
messagesSupportedRequired non-empty list; validated and forwarded to the inference engine.
streamSupportedStreaming path implemented; stream_options.include_usage is injected automatically.
temperatureSupportedPassed through to the inference engine; also logged for billing metadata.
top_pSupportedListed in supported_sampling_parameters and forwarded.
max_tokensSupportedPassed through; guest sandbox requests are capped to 256 tokens.
stopSupportedListed in supported_sampling_parameters and forwarded.
nUntestedNo gateway-level handling; forwarded unchanged. Behavior depends on the backend.
logprobsUntestedNo gateway-level handling; forwarded as part of the raw body. Not verified against live responses.
toolsSupportedListed in supported_features: ["tools", "json_mode"] and forwarded.
response_formatSupportedGateway advertises json_mode; the field is forwarded as part of the raw body.
vision inputUntestedModel metadata declares input_modalities: ["text"]. Gateway extracts image_url only for the CSAM hash check; inference behavior unverified.

Source of truth: the /v1/chat/completions handler and /v1/models capability metadata.

Minimal sample app

A single-file interactive chat loop with streaming output. Copy, set INFERWAY_API_KEY, and run. Requires pip install openai.

Minimal sample apppython
#!/usr/bin/env python3
"""Minimal Inferway chat sample. Requires: pip install openai"""
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.inferway.ai/v1",
    api_key=os.environ["INFERWAY_API_KEY"],
)

messages = [{"role": "system", "content": "You are a helpful assistant."}]

while True:
    user = input("You: ")
    if not user:
        break
    messages.append({"role": "user", "content": user})
    stream = client.chat.completions.create(
        model="inferway/qwen3-8-27b",
        messages=messages,
        stream=True,
    )
    reply = ""
    print("Assistant: ", end="", flush=True)
    for chunk in stream:
        if not chunk.choices:
            continue
        piece = chunk.choices[0].delta.content
        if piece:
            reply += piece
            print(piece, end="", flush=True)
    print("\n")
    messages.append({"role": "assistant", "content": reply})

Next steps