Documentation
Getting started
- Create an account and verify your email.
- Add credit on the Billing page.
- Create a key on the API keys page. Keys start with
sk-tx-. - Point your SDK at
https://mytenon.comand use the key in place of the vendor's key.
Endpoints
| API | Path | Auth header |
|---|---|---|
| OpenAI Chat Completions | POST /v1/chat/completions | Authorization: Bearer |
| OpenAI Responses | POST /v1/responses | Authorization: Bearer |
| OpenAI Embeddings | POST /v1/embeddings | Authorization: Bearer |
| Anthropic Messages | POST /v1/messages | x-api-key or Bearer |
| Gemini | POST /v1beta/models/{model}:generateContent POST /v1beta/models/{model}:streamGenerateContent | x-goog-api-key or ?key= |
| List models | GET /v1/models | any |
| OpenAI Batch | POST /v1/files POST /v1/batches · GET /v1/batches/{id} GET /v1/files/{id}/content | Authorization: Bearer |
| Anthropic Message Batches | POST /v1/messages/batches GET /v1/messages/batches/{id}/results | x-api-key or Bearer |
Each endpoint speaks its vendor's protocol: send Claude models to /v1/messages, Gemini models to /v1beta, and OpenAI models to /v1/chat/completions or /v1/responses. The full model list and prices are on the pricing page.
SDK examples
from openai import OpenAI
client = OpenAI(base_url="https://mytenon.com/v1", api_key="sk-tx-...")
reply = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello!"}],
)
print(reply.choices[0].message.content)Batch API
Asynchronous jobs at discounted batch rates, through the OpenAI Files + Batches API (/v1/files, /v1/batches) and Anthropic Message Batches (/v1/messages/batches). Up to 50,000 requests per batch; results within 24 hours; you pay only for requests that complete. Prices and a quick start are on the Batch API page.
from openai import OpenAI
import json
client = OpenAI(base_url="https://mytenon.com/v1", api_key="sk-tx-...")
# requests.jsonl: one request per line
with open("requests.jsonl", "w") as f:
for i, text in enumerate(["first document", "second document"]):
f.write(json.dumps({
"custom_id": f"doc-{i}",
"method": "POST",
"url": "/v1/chat/completions",
"body": {"model": "gpt-4.1-mini",
"messages": [{"role": "user", "content": f"Summarise: {text}"}]},
}) + "\n")
file = client.files.create(file=open("requests.jsonl", "rb"), purpose="batch")
batch = client.batches.create(input_file_id=file.id,
endpoint="/v1/chat/completions",
completion_window="24h")
# later
batch = client.batches.retrieve(batch.id)
if batch.status == "completed":
print(client.files.content(batch.output_file_id).text)Coding tools
Claude Code
export ANTHROPIC_BASE_URL=https://mytenon.com
export ANTHROPIC_AUTH_TOKEN=sk-tx-...
claudeCodex CLI
Add a provider to ~/.codex/config.toml, then export TENON_API_KEY:
model_provider = "tenon"
model = "gpt-4.1"
[model_providers.tenon]
name = "Tenon"
base_url = "https://mytenon.com/v1"
env_key = "TENON_API_KEY"
wire_api = "responses"Anything OpenAI-compatible
Set the base URL to https://mytenon.com/v1 and the API key to your sk-tx- key.
Errors
| Status | Meaning |
|---|---|
| 400 | The request was rejected by the model provider; the message explains why. |
| 401 | Missing, invalid, disabled or expired API key. |
| 402 | Balance is used up, or the key reached its spending limit. Top up or raise the limit. |
| 403 | The key is not allowed to use this model. |
| 404 | Unknown model. Check the pricing page for exact names. |
| 429 | Upstream capacity is temporarily exhausted. Retry with backoff. |
| 503 | No upstream could serve the request right now. Retry shortly. |
Limits
- Request bodies are limited to 4.5 MB. Send large images by URL rather than base64 where the API allows it.
- A single request can run for up to 5 minutes.
- Realtime (WebSocket) APIs are not available.