Base URL and authentication
The URLs, headers and request formats of the TokenReply API.
Send your first request
Using API keys has the API URL and ready-to-run Python, Node.js and cURL examples.
Endpoints
| Setting | Value |
|---|---|
| API origin | https://api.tokenreply.com |
| SDK Base URL | https://api.tokenreply.com/v1 |
| Direct HTTP endpoint (example) | https://api.tokenreply.com/v1/chat/completions |
| Authentication header | Authorization: Bearer sk-xxx |
| Content-Type | application/json |
Which URL to use
In an OpenAI SDK, base_url ends in /v1. For direct HTTP requests, use the full endpoint, such as /v1/chat/completions.
Authentication
Send your API key in this header with every request:
Authorization: Bearer sk-your-token-hereGet a key in API key management. Using API keys walks you through connecting.
Request and response formats
- Requests and responses use JSON. File uploads use multipart, and audio comes back as binary
- For streaming (SSE, Server-Sent Events), set
"stream": truein the request body - Most apps use
/v1/chat/completions - Also supported:
/v1/responses,/v1/embeddings,/v1/images/generationsand more
Rate-limit headers
Responses can include these rate-limit headers:
| Header | Description |
|---|---|
x-ratelimit-limit-requests | Requests allowed in the current window |
x-ratelimit-remaining-requests | Requests left in the current window |
x-ratelimit-reset-requests | Time until the window resets |
Next steps
- Send your first request with Using API keys
- Copy streaming and direct HTTP code from Code examples
- See what each endpoint does in Compatibility
- Find a model to use in Models and rules
