Skip to main content
AINew

AI Router

One OpenAI-compatible API for every model you use.

Point any OpenAI SDK at one endpoint and route chat requests through the HostingSwift gateway. Per-key budgets and rate limits, usage metering, secret redaction and automatic provider fallback are built in.

At a glance

Base URL
https://hostingswift.com/api/v1
Auth
Authorization: Bearer hs-sk-...
Endpoints
POST /chat/completions, GET /models
Streaming
Server-sent events

Why AI Router

Part of the same platform as every other HostingSwift service: one account, one panel, one invoice.

  • OpenAI-compatible

    Use /v1/chat/completions and /v1/models with the SDKs and tools you already have. Change the base URL and key, nothing else.

  • Scoped API keys

    Create keys in the panel, restrict them to specific models, give each a budget and a requests-per-minute limit, revoke any time.

  • Usage metering

    Every request is metered in tokens and billed from your account credit at the per-model rate shown in the catalogue.

  • Prompt guardrails

    Optional redaction of secrets and personal data (API keys, private keys, emails, card numbers) before a prompt leaves the gateway.

  • Provider fallback

    If the first upstream provider is down or rate limited, the gateway retries through the next one in the chain.

  • Streaming

    Server-sent events streaming with stream: true, passed through as they arrive.

Make your first call in a minute

  1. Create an account and add credit (or use a free model).
  2. Create an API key in the AI Router section of your panel.
  3. Point your SDK at the base URL below and send a request.

Full reference: authentication, models, errors and rate limits.

curl https://hostingswift.com/api/v1/chat/completions \
  -H "Authorization: Bearer $HS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-chat",
    "messages": [
      {"role": "system", "content": "You are a concise assistant."},
      {"role": "user", "content": "Explain DNS TTLs in two sentences."}
    ]
  }'

Models and per-token rates

Billed per token from account credit. Rates are in US dollars per 1 million tokens and come straight from the live catalogue.

AI models and per-token pricing
Model IDContextInput / 1M tokensOutput / 1M tokens
deepseek-chatDeepSeek Chat64K$0.40$0.80
deepseek-4.1-liteDeepSeek 4.1 Lite (OpenRouter)64K$0.30$0.60
deepseek-4.1-lite:freeFreeDeepSeek 4.1 Lite (Free tier)32KFreeFree

Model availability can change. The authoritative list for your key is GET /models; see the API docs.

What's included

  • OpenAI-compatible chat completions endpoint
  • Model catalogue endpoint (GET /models)
  • Hashed API keys, shown once at creation
  • Per-key model allow-list, budget and rate limit
  • Token usage and cost records in your panel
  • Free-tier models where flagged in the catalogue

Technical specifications

Base URL
https://hostingswift.com/api/v1
Auth
Authorization: Bearer hs-sk-...
Endpoints
POST /chat/completions, GET /models
Streaming
Server-sent events
Max output tokens
8,192 per request
Default rate limit
60 requests per minute per key (adjustable per key)

Frequently asked questions

Is it a drop-in replacement for the OpenAI API?

For chat completions and model listing, yes: the request and response shapes follow the OpenAI format. Other endpoints (images, embeddings, audio) are not exposed yet.

How am I billed?

Per token, from your account credit, at the input and output rate listed for each model. Models flagged free in the catalogue cost nothing.

Are my prompts stored?

We record usage metadata (model, token counts, cost, status) for billing and your usage dashboard. See the privacy policy for retention details.

What happens when my credit or key budget runs out?

Requests return HTTP 402 with a clear error code (insufficient_credit or budget_exceeded) until you top up or raise the budget.

Get started with AI Router

Create an account and launch from your client panel. Check the pricing page for what is free.

Explore more services