Base URL
All API endpoints are relative to the following base URL:https://api.portrix.ai/v1/chat/completions.
Authentication
Portrix authenticates requests using Bearer tokens in theAuthorization header. You can generate an API key from your dashboard at app.portrix.ai.
Endpoints
Chat Completions
POST /v1/chat/completionsGenerate chat responses from any model using a conversation history. The primary endpoint for most use cases.
Text Completions
POST /v1/completionsLegacy prompt-based text completion for workflows that require a raw continuation rather than a chat turn.
Embeddings
POST /v1/embeddingsConvert text into numeric vector representations for semantic search, clustering, and retrieval-augmented generation.
Models
GET /v1/modelsRetrieve the full list of AI models available through Portrix, including provider metadata and capability flags.
Request Format
All requests must use a JSON body with theContent-Type: application/json header set. All responses are also returned as JSON. For streaming endpoints, responses use text/event-stream (Server-Sent Events).
Model IDs
Portrix uses a{provider}/{model} naming convention for all model IDs. This tells the gateway which upstream provider to route your request to. For example:
Pass the full
provider/model string in the model field of any request body.
Portrix-Specific Headers
In addition to the standard OpenAI-compatible headers, Portrix supports several request headers that control routing, fallback, and search behavior. You can attach these to any request.Rate Limits
Portrix enforces rate limits on a per-key basis. When you exceed a limit, the API returns a429 Too Many Requests response with a Retry-After header indicating when you can retry. See the Rate Limits guide for information on default limits, how to check your current usage, and how to request an increase.
SDKs
You can use Portrix with any OpenAI-compatible SDK by setting thebase_url and api_key. No custom SDK required.
Python SDK
Use the official
openai Python package pointed at the Portrix base URL.TypeScript / Node.js SDK
Use the
openai npm package with a custom baseURL option.REST / cURL
Call the API directly with any HTTP client — no SDK required.
LangChain & LlamaIndex
Drop Portrix in as the LLM provider in popular orchestration frameworks.