# SilentAPI Documentation > Full SilentAPI documentation in one file. Updated 2026-10-07. SilentAPI is a private API gateway for AI models and developer tools. One API key works with OpenAI, Anthropic, and Gemini request formats. SilentAPI does not keep prompts or outputs, and model providers can not link a request to an account. Accounts are prepaid with anonymized crypto payments or direct Monero deposits. The website and API also run on Tor and I2P. SilentAPI aims for 99.99% monthly uptime. ## Contents - [Overview](https://silentapi.com/docs/overview) - [Authentication](https://silentapi.com/docs/authentication) - [OpenAI Style](https://silentapi.com/docs/openai) - [Anthropic Style](https://silentapi.com/docs/anthropic) - [Gemini Style](https://silentapi.com/docs/gemini) - [Streaming](https://silentapi.com/docs/streaming) - [Fallbacks](https://silentapi.com/docs/fallbacks) - [Media and OCR](https://silentapi.com/docs/media) - [Billing & Credits](https://silentapi.com/docs/billing) - [Error Codes](https://silentapi.com/docs/errors) - [Rate Limits](https://silentapi.com/docs/rate-limits) Source: https://silentapi.com/docs/overview # Overview What SilentAPI is and how it works SilentAPI is a privacy-focused API platform for AI models and developer services. One API key and balance work across supported services. SilentAPI does not keep your prompts or outputs for normal API calls. SilentAPI does not send your account identifiers or IP address to providers. ## How It Works Send a request to the endpoint with your SilentAPI API key. SilentAPI returns the selected model's response. It charges your balance for the request. Use the API format that your application needs. ## Base URLs | Network | Base URL | | --- | --- | | Public internet | `https://api.silentapi.com/v1` | | Tor | `http://zwcbz3ftcbwhr2ercjghbozbqjj544mhwqd7guvjrxv2dkzwlq2prpyd.onion/v1` | | I2P | `http://ztkguqwo54vcgdgnji75k65exenh2hyznyfl4o7i5e3tin7padba.b32.i2p/v1` | The Tor and I2P addresses also serve this website. ## Quick Start - Create an account on the [SilentAPI home page](https://silentapi.com/). - Generate an API key on the [Keys page](https://silentapi.com/keys). - Add credits on the [Recharge page](https://silentapi.com/recharge). - Send your first request: ``` curl https://api.silentapi.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "model": "gemini-3.8-flash", "messages": [{"role":"user","content":"What is SilentAPI?"}], "reasoning_effort": "medium" }' ``` ## API Styles SilentAPI supports these API request formats. They share the same key and balance. Use the format that matches your SDK: - OpenAI Style: OpenAI Chat Completions API, Completions API, and Responses API. - Anthropic Style: Anthropic Messages API at `/v1/messages`. - Gemini Style: `generateContent` and `streamGenerateContent` under `/v1beta/models/{model}`. See the individual pages for each style in the sidebar. ## Pricing Prices are in credits. One credit equals $0.01 USD. Token services use input and output prices. The request charge uses the tokens and units reported by the service. See [Billing & Credits](https://silentapi.com/docs/billing) for details. Current prices are on the [Services page](https://silentapi.com/services) and [Calculator](https://silentapi.com/calculator). The site chat uses `gemini-3.8-flash` with medium thinking by default. ## Privacy Labels ZDR means zero data retention. Each model shows one privacy label on the [Services page](https://silentapi.com/services). Hover the label to read its meaning. | Label | Meaning | | --- | --- | | End-to-end ZDR | SilentAPI does not keep your prompts or outputs, and the provider route has zero data retention. | | SilentAPI protected | SilentAPI does not keep your prompts or outputs. The provider may keep logs under its own terms. | ## Lookup Services Send lookup values in the JSON body. Do not put API keys or lookup values in a URL. ### IP Lookup ``` curl https://api.silentapi.com/v1/silentapi/ip-lookup \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{"ip":"9.9.9.9"}' ``` Each call costs 0.001 credits. IP data updates daily. The response does not include history fields or the complete network range. Example response: ``` { "status": "ok", "9.9.9.9": { "network": { "asn": "AS64500", "as_name": "Example Network", "organisation": "Example Network", "isp": "Example Network", "type": "hosting" }, "location": { "continent": "North America", "continent_code": "NA", "country": "United States", "country_code": "US", "region": "Example Region", "city": "Example City", "latitude": 40.7, "longitude": -74.0 }, "detections": { "proxy": false, "vpn": false, "tor": false, "hosting": true, "cloud": false, "risk": 40 } }, "cost": 0.001 } ``` `hosting` is true for data center and hosting addresses. `cloud` is true when the address is in the published address ranges of a public cloud provider. Cloud addresses also count as hosting. Some values can be unknown: | Case | Response | | --- | --- | | Unknown location or network value | The field is absent | | Unknown ASN | The `asn` field is absent | | Reserved IP address | The address field contains `{"ip":"127.0.0.1","type":"reserved"}` | ### Email Lookup ``` curl https://api.silentapi.com/v1/silentapi/email-lookup \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{"email":"example@example.com"}' ``` Each call costs 0.001 credits. Email lists update daily. The lookup checks the email format and its domain. It also checks mail servers and disposable domains. It does not prove that a mailbox exists. Example response: ``` { "status": "ok", "example@example.com": { "valid": true, "detections": { "disposable": false } }, "cost": 0.001 } ``` ## Media and OCR The media endpoints process files. OCR reads text from documents and images. See [Media and OCR](https://silentapi.com/docs/media) for the supported services and request limits. ## Service Status Read live status on [[ Status ]](https://silentapi.com/status). You can also read status from the API. The status endpoints need no API key. | Method | Path | Description | | --- | --- | --- | | GET | `/status` | Current status and uptime of each group | | GET | `/status/history` | Current status and uptime, with latency and history buckets | ``` curl https://api.silentapi.com/status/history ``` Both endpoints are cached for 60 seconds. Each address can send 60 requests per minute. More requests return HTTP `429` with `Retry-After: 60`. Browser apps can call these endpoints from any origin. ### Status Response | Field | Type | Meaning | | --- | --- | --- | | updated_at | string | Time of the data in ISO 8601 format, in UTC | | groups | array | One item for each service group | | groups[].id | string | Group ID: `website`, `api`, `tor`, or `i2p` | | groups[].name | string | Group name: Website, API, Tor, or I2P | | groups[].status | string | Current status. See the status values below. | | groups[].uptime.24h | number or null | Uptime percentage for the last 24 hours | | groups[].uptime.30d | number or null | Uptime percentage for the last 30 days | | groups[].uptime.365d | number or null | Uptime percentage for the last 365 days | Uptime is the percentage of successful checks, with up to two decimal places. It is `null` when no checks exist for that period. | Status | Meaning | | --- | --- | | operational | All checks in the last 5 minutes passed | | degraded | Some checks in the last 5 minutes failed | | down | All checks failed in the 3 most recent minutes | | unknown | No checks exist for the last 5 minutes | ### History Response `GET /status/history` returns the status response. It adds these fields to each group: | Field | Type | Meaning | | --- | --- | --- | | latency_ms | integer or null | Average latency for the last 24 hours, in milliseconds | | days | array | 30 daily buckets, oldest first | | hours | array | 24 hourly buckets, oldest first | | weeks | array | 52 weekly buckets, oldest first. Each bucket is 7 days. The last bucket ends today. | Each bucket has these fields: | Field | Type | Meaning | | --- | --- | --- | | t | integer | Start of the bucket. See the table below. | | up | integer | Number of successful checks | | total | integer | Number of all checks | | latency_ms | integer or null | Average latency of successful checks, in milliseconds | | Bucket | Value of t | | --- | --- | | days | UTC day number: `floor(ms / 86400000)` | | hours | UTC hour number: `floor(ms / 3600000)` | | weeks | UTC day number of the first day of the week | `ms` is the time in milliseconds since the Unix epoch. A bucket with no checks has `up` and `total` set to 0 and `latency_ms` set to `null`. Latency is the server response time of successful checks. Failed checks count as downtime. They do not count in latency. Source: https://silentapi.com/docs/authentication # Authentication How to authenticate your API requests Requests under `/v1` and `/v1beta` need an API key. Create an account on the [home page](https://silentapi.com/). Generate an API key on the [Keys page](https://silentapi.com/keys). The public status endpoints and the public model list need no API key. See [Overview](https://silentapi.com/docs/overview) and [OpenAI Style](https://silentapi.com/docs/openai) for details. ## API Key Security SilentAPI stores API keys as hashes. Treat your API keys like passwords. Do not commit them to version control. Do not put them in browser code or logs. ## Sending Your Key Send your API key in a supported header. Query parameters are available for clients that require them. | Name | Location | Value | | --- | --- | --- | | Authorization | Header | `Bearer YOUR_API_KEY` | | x-api-key | Header | `YOUR_API_KEY` | | x-goog-api-key | Header | `YOUR_API_KEY` | | apiKey | Query parameter | `YOUR_API_KEY` | | key | Query parameter | `YOUR_API_KEY` | ### Authorization Header (Recommended) ``` Authorization: Bearer YOUR_API_KEY ``` This works with the OpenAI SDK, the Anthropic SDK, curl, and most HTTP libraries. ### x-api-key Header ``` x-api-key: YOUR_API_KEY ``` The Anthropic SDK sends the `x-api-key` header. All authenticated API endpoints accept it. ### x-goog-api-key Header ``` x-goog-api-key: YOUR_API_KEY ``` The Google GenAI SDK sends the `x-goog-api-key` header. All authenticated API endpoints accept it. ### Query Parameter ``` https://api.silentapi.com/v1/chat/completions?apiKey=YOUR_API_KEY ``` ``` https://api.silentapi.com/v1/chat/completions?key=YOUR_API_KEY ``` Use a query parameter only when a client cannot set a header. Query parameter authentication puts your API key in the URL. A URL can appear in logs. Use the Authorization header when possible. ## SDK Examples ### OpenAI SDK (Python) ``` from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.silentapi.com/v1" ) response = client.chat.completions.create( model="gpt-6-sol", messages=[{"role": "user", "content": "Hello"}] ) print(response.choices[0].message.content) ``` ### OpenAI SDK (JavaScript) ``` import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.silentapi.com/v1" }); const response = await client.chat.completions.create({ model: "gpt-6-sol", messages: [{ role: "user", content: "Hello" }] }); const responseText = response.choices[0].message.content; ``` ### Anthropic SDK (Python) ``` import anthropic client = anthropic.Anthropic( api_key="YOUR_API_KEY", base_url="https://api.silentapi.com" ) message = client.messages.create( model="claude-sonnet-5.5", max_tokens=1024, messages=[{"role": "user", "content": "Hello"}] ) print(message.content[0].text) ``` ### Google GenAI SDK (Python) ``` from google import genai client = genai.Client( api_key="YOUR_API_KEY", http_options={"base_url": "https://api.silentapi.com"} ) response = client.models.generate_content( model="gemini-3.8-flash", contents="Hello" ) print(response.text) ``` ## Per-Key Budgets Set a monthly credit budget on each API key on the [Keys page](https://silentapi.com/keys). Requests with that API key return HTTP `402` when its budget is reached. Source: https://silentapi.com/docs/openai # OpenAI Style Use endpoints compatible with the OpenAI API SilentAPI provides endpoints compatible with the OpenAI API. If your codebase uses the OpenAI SDK, change the base URL and API key. Request and response shapes follow the OpenAI API. ## Endpoints | Method | Path | Description | | --- | --- | --- | | POST | `/v1/chat/completions` | Chat completions | | POST | `/v1/completions` | Legacy text completions | | POST | `/v1/responses` | Responses API | | POST | `/v1/embeddings` | Create embeddings | | POST | `/v1/audio/speech` | Text to speech | | POST | `/v1/audio/transcriptions` | Speech to text | | POST | `/v1/images/generations` | Image generation | | POST | `/v1/images/edits` | Image edits | | GET | `/v1/models` | List available models | | GET | `/v1/models/{id}` | Get one model | ## Chat Completions Send an OpenAI Chat Completions API request with the `model` and `messages` fields: ``` curl https://api.silentapi.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "model": "gpt-6-sol", "messages": [{"role":"user","content":"Explain how APIs work."}] }' ``` Response: ``` { "id": "chatcmpl_1719584000", "object": "chat.completion", "created": 1719584000, "model": "gpt-6-sol", "choices": [{ "index": 0, "message": { "role": "assistant", "content": "An API is like a waiter in a restaurant..." }, "finish_reason": "stop" }], "usage": { "prompt_tokens": 8, "completion_tokens": 156, "total_tokens": 164 }, "silentapi": { "cost": 0.000117, "fallback": null } } ``` ## Using the OpenAI SDK ### Python ``` from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.silentapi.com/v1" ) response = client.chat.completions.create( model="gpt-6-sol", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello!"} ] ) ``` Send conversation messages in `messages`. Send system instructions as a message with `role: "system"`. Use `prompt` only with the Completions API. ## Embeddings Send text in the `input` field. Use `gemini-embedding-2` or `text-embedding-3-small`. ``` curl https://api.silentapi.com/v1/embeddings \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{"model":"gemini-embedding-2","input":"SilentAPI API documentation"}' ``` `encoding_format: "base64"` works on every model. `dimensions` is sent to models that support it. See [Embeddings](https://silentapi.com/docs/media#embedding-options) in Parameter Handling. ## Text to Speech Send text in the `input` field. The response is audio. ``` curl https://api.silentapi.com/v1/audio/speech \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{"model":"gemini-3.8-flash-tts","input":"Your request is ready.","voice":"Kore","response_format":"wav"}' \ -o speech.wav ``` Every speech model accepts `mp3`, `wav`, `opus`, `aac`, `flac`, and `pcm`. When a model cannot make the requested format, you get the closest format it supports. The `X-SilentAPI-Format` header shows the real format. See [Speech](https://silentapi.com/docs/media#speech-options) in Parameter Handling. ## Speech to Text Send an audio file in the multipart `file` field. Use `gpt-transcribe`. ``` curl https://api.silentapi.com/v1/audio/transcriptions \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@recording.mp3" \ -F "model=gpt-transcribe" ``` `response_format` can be `json`, `text`, `verbose_json`, `srt`, or `vtt` on every model. See [Transcription](https://silentapi.com/docs/media#transcription-options) in Parameter Handling. ## Current Models Use `gpt-6.1-sol` for balanced work. These GPT models are available: | Model | Reasoning levels | | --- | --- | | gpt-6.1-sol | `low`, `medium`, `high`, `xhigh`, `max` | | gpt-6-astra | `low`, `medium`, `high`, `xhigh`, `max` | | gpt-6-sol | `none`, `low`, `medium`, `high`, `xhigh`, `max` | | gpt-6-luna | `none`, `low`, `medium`, `high`, `xhigh`, `max` | Read [[ Services ]](https://silentapi.com/services) or the [model list](#model-discovery) for the current models and levels. `gpt-6.1-sol` supports function calling. Send function definitions in `tools`. Your application runs the functions requested by the model. ## Supported Parameters | Parameter | Type | Description | | --- | --- | --- | | model | string | The model ID (see [Services](https://silentapi.com/services)) | | messages | array | Multi-turn conversation messages | | temperature | number | Sampling temperature (0 to 2) | | max_tokens | integer | Maximum output tokens | | max_completion_tokens | integer | Maximum completion tokens (GPT 6 and GPT 5.6 models) | | top_p | number | Nucleus sampling parameter | | reasoning_effort | string | Reasoning level: `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`. See [Reasoning](#reasoning). | | response_format | object | JSON Schema or JSON object mode | | tools | array | Function calling tool definitions | | stream | boolean | Enable SSE streaming (see [Streaming](https://silentapi.com/docs/streaming)) | | webhook_url | string | Receive the response payload as a POST callback | ## Parameter Handling Some values are valid in the OpenAI API but not on every model. SilentAPI changes them so the request does not fail: | Parameter | Handling | | --- | --- | | temperature | Limited to 0 to 2 | | top_p, min_p | Limited to 0 to 1 | | frequency_penalty, presence_penalty | Limited to -2 to 2 | | repetition_penalty | Limited to 0 to 2 | | max_tokens, max_completion_tokens | A decimal value becomes the whole number below it. A value below 1 is ignored. | | Numbers sent as text | Changed to numbers, for example `"0.5"` becomes `0.5`. A value that is not a number is ignored. | | reasoning_effort, reasoning.effort | Changed to the closest level the model supports. See [Reasoning](#reasoning). | For media endpoints, see [Parameter Handling](https://silentapi.com/docs/media#parameter-handling) in Media and OCR. ## Reasoning Chat models accept a reasoning level. The field depends on the endpoint: | Endpoint | Field | | --- | --- | | Chat Completions API | `reasoning_effort` | | Responses API | `reasoning.effort` | | Native model routes, such as `/v1/google/gemini-3.8-flash` | `reasoning_effort`, or the alias `thinkingLevel` | | Anthropic Messages API | `thinking`. See [Anthropic Style](https://silentapi.com/docs/anthropic#reasoning). | | Gemini `generateContent` | `generationConfig.thinkingConfig`. See [Gemini Style](https://silentapi.com/docs/gemini#reasoning). | ``` curl https://api.silentapi.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "model": "gpt-6.1-sol", "messages": [{"role":"user","content":"Plan a three-step database migration."}], "reasoning_effort": "high" }' ``` | Value | Label | | --- | --- | | none | None. Off on models that support only on or off. | | minimal | Minimal | | low | Low | | medium | Medium | | high | High | | xhigh | Extra High | | max | Max | | on | On. Used by models that support only on or off. | Each model supports its own set of levels. Read them in `silentapi.reasoning` in the [model list](#model-discovery). SilentAPI changes the request to fit the model: | Model levels | Result | | --- | --- | | A list of levels, for example `["low", "medium", "high"]` | SilentAPI uses the requested level when the model supports it. Otherwise it uses the closest supported level. When two levels are equally close, it uses the higher level. | | `["none", "on"]` | The model accepts only on or off. `none` turns reasoning off. Any other level turns it on. | | `[]` | The model always reasons. SilentAPI ignores the requested level. | | Model levels | Request | Level used | | --- | --- | --- | | `["low", "medium", "high"]` | `xhigh` | `high` | | `["low", "medium", "high"]` | `none` | `low` | | `["none", "on"]` | `high` | On | | `[]` | `low` | The model default | SilentAPI also accepts these aliases: | Request value | Same as | | --- | --- | | on, enabled, true | `on`. On a model with a list of levels, SilentAPI uses `medium` or the closest supported level. | | off, disabled, false | `none` | SilentAPI ignores a value that is not in these tables. The model then uses its default. Chat Completions also accepts a `reasoning` object. SilentAPI reads it when `reasoning_effort` is absent: | Field | Handling | | --- | --- | | reasoning.effort | Same as `reasoning_effort` | | reasoning.max_tokens | A token budget. SilentAPI changes it to a level with the [budget table](https://silentapi.com/docs/anthropic#reasoning), then to the closest level the model supports. | | reasoning.enabled | `true` is the same as `on`. `false` is the same as `none`. | A model that cannot turn reasoning off gets its lowest level for `none`. A model that always reasons with a fixed level gets no reasoning fields. Other fields in `reasoning`, such as `exclude`, are kept. ## Image Generation ``` curl https://api.silentapi.com/v1/images/generations \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "model": "gpt-image-2.5-flare", "prompt": "A serene mountain landscape at sunset", "n": 1, "size": "1024x1024" }' ``` SilentAPI changes `size`, `aspect_ratio`, `n`, `response_format`, and `output_format` to fit each image model. See [Image Generation](https://silentapi.com/docs/media#image-options) in Parameter Handling. ## Video Video generation runs as a job. Create the job. Poll its status until it completes. Download the MP4 file. | Method | Path | Description | | --- | --- | --- | | POST | `/v1/videos` | Create a video job | | GET | `/v1/videos/{id}` | Get the job status | | GET | `/v1/videos/{id}/content` | Download the finished video (MP4) | ``` curl https://api.silentapi.com/v1/videos \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "model": "minimax-h3-max", "prompt": "A paper boat drifting down a rainy street", "duration": 6, "resolution": "768p", "aspect_ratio": "16:9" }' ``` The API returns `202 Accepted`: ``` { "id": "video_abc123", "status": "processing", "status_url": "/v1/videos/video_abc123" } ``` Poll the status until the job is done: ``` curl https://api.silentapi.com/v1/videos/video_abc123 \ -H "Authorization: Bearer YOUR_API_KEY" ``` Download the video: ``` curl https://api.silentapi.com/v1/videos/video_abc123/content \ -H "Authorization: Bearer YOUR_API_KEY" \ -o video.mp4 ``` ## Model Discovery `GET /public/models` lists every model in the OpenAI list format. It needs no API key. Use it in tools and apps that read a model list. Browser apps can call it from any origin. ``` curl https://api.silentapi.com/public/models ``` `GET /v1/models` returns the same list. It needs an API key. `GET /v1/models/{id}` returns one item. ``` curl https://api.silentapi.com/v1/models \ -H "Authorization: Bearer YOUR_API_KEY" ``` The response is `{"object": "list", "data": [...]}`. Example item. Prices are examples: ``` { "id": "gemini-3.8-flash", "object": "model", "created": 1790000000, "owned_by": "silentapi", "name": "Gemini 3.8 Flash", "display_name": "Gemini 3.8 Flash", "context_length": 1048576, "max_output_tokens": 65536, "input_modalities": ["text", "image", "video", "file", "audio"], "output_modalities": ["text"], "pricing": { "prompt": "9.38e-7", "completion": "0.00000469", "input_cache_read": "9.38e-8" }, "silentapi": { "model_name": "Gemini 3.8 Flash", "vendor": "Google AI", "family": "Gemini", "category": "multimodal", "resilient": true, "privacy": "e2e", "privacy_label": "End-to-end ZDR", "reasoning": ["low", "medium", "high"] } } ``` | Field | Type | Meaning | | --- | --- | --- | | id | string | Model ID. Send it in the `model` field. | | object | string | Always `model` | | created | integer | Unix time in seconds | | owned_by | string | Always `silentapi` | | name | string | Model name | | display_name | string | Model name. Same as `name`. | | context_length | integer or null | Maximum context in tokens | | max_output_tokens | integer or null | Maximum output tokens | | input_modalities | array | Input types, for example `text` or `image` | | output_modalities | array | Output types | | pricing | object | Token prices. Absent when the model has no token prices. | | silentapi | object | SilentAPI model details | `pricing` has these fields. Each price is in USD per token, as a string. A price can use exponent notation, for example `9.38e-7`. | Field | Type | Meaning | | --- | --- | --- | | prompt | string | Price of one input token | | completion | string | Price of one output token | | input_cache_read | string | Price of one cached input token. Only when it applies. | | input_cache_write | string | Price of one cache write token. Only when it applies. | `silentapi` has these fields: | Field | Type | Meaning | | --- | --- | --- | | model_name | string | Model name | | vendor | string | Model vendor | | family | string | Model family | | category | string | Service type, for example `multimodal`, `text`, `image`, or `embedding` | | privacy | string | `e2e` or `silentapi` | | privacy_label | string | End-to-end ZDR or SilentAPI protected. See [Privacy Labels](https://silentapi.com/docs/overview). | | resilient | boolean | `true` when fallback models exist | | reasoning | array | Supported reasoning levels. Chat models only. See [Reasoning](#reasoning). | ## Cross-Style Usage Use any supported text or multimodal model with the OpenAI Chat Completions API. For example, `gemini-3.8-flash` returns the OpenAI response format. Use the separate media endpoints for embeddings, images, speech, and video. Source: https://silentapi.com/docs/anthropic # Anthropic Style Use the Anthropic Messages API format SilentAPI provides an endpoint compatible with the Anthropic Messages API at `/v1/messages`. Point the Anthropic SDK at SilentAPI and send your API key. ## Endpoint | Method | Path | Description | | --- | --- | --- | | POST | `/v1/messages` | Create a message (Anthropic Messages API) | ## Basic Request ``` curl https://api.silentapi.com/v1/messages \ -H "Content-Type: application/json" \ -H "x-api-key: YOUR_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "claude-sonnet-5.5", "max_tokens": 1024, "messages": [{"role":"user","content":"What is zero data retention (ZDR)?"}] }' ``` Response: ``` { "id": "msg_1719584000", "type": "message", "role": "assistant", "model": "claude-sonnet-5.5", "content": [{ "type": "text", "text": "Zero data retention means no prompts or outputs are kept." }], "stop_reason": "end_turn", "stop_sequence": null, "usage": { "input_tokens": 7, "output_tokens": 89 }, "silentapi": { "cost": 0.000084, "fallback": null } } ``` ## Using the Anthropic SDK ### Python ``` import anthropic client = anthropic.Anthropic( api_key="YOUR_API_KEY", base_url="https://api.silentapi.com" ) message = client.messages.create( model="claude-sonnet-5.5", max_tokens=1024, messages=[ {"role": "user", "content": "Explain quantum computing"} ] ) print(message.content[0].text) ``` ### TypeScript ``` import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic({ apiKey: "YOUR_API_KEY", baseURL: "https://api.silentapi.com" }); const message = await client.messages.create({ model: "claude-sonnet-5.5", max_tokens: 1024, messages: [{ role: "user", content: "Explain quantum computing" }] }); const responseText = message.content[0].text; ``` ## Supported Parameters | Parameter | Type | Description | | --- | --- | --- | | model | string | A supported text or multimodal model ID | | messages | array | Multi-turn conversation messages | | system | string | System instruction | | max_tokens | integer | Maximum output tokens (required by Anthropic API) | | temperature | number | Sampling temperature | | top_p | number | Nucleus sampling parameter | | stop_sequences | array | Sequences that stop generation | | tools | array | Function definitions with name and input_schema | | tool_choice | object | Select auto, any, none, or a named tool | | thinking | object | Thinking configuration. See [Reasoning](#reasoning). | | stream | boolean | Enable SSE streaming (see [Streaming](https://silentapi.com/docs/streaming)) | ## Reasoning Send `thinking` with `type: "enabled"`. SilentAPI changes `budget_tokens` to a reasoning level: | budget_tokens | Reasoning level | | --- | --- | | Absent | `medium` | | 1 to 2,048 | `low` | | 2,049 to 8,192 | `medium` | | 8,193 to 32,768 | `high` | | 32,769 to 65,536 | `xhigh` | | More than 65,536 | `max` | Each model supports its own set of levels. SilentAPI changes an unsupported level to the closest supported level. See [Reasoning](https://silentapi.com/docs/openai#reasoning) for the rules. ### Parameter Handling | Request | Handling | | --- | --- | | `thinking.type: "disabled"` | Level `none`. Reasoning is off on models that can turn it off. Other models use their lowest level. | | `thinking.type: "adaptive"` without `budget_tokens` | Level `medium` | | `output_config.effort` | Used as the level: `low`, `medium`, `high`, `xhigh`, or `max`. It wins over `budget_tokens`. `thinking.type: "disabled"` wins over it. | | `budget_tokens` on any model | Changed to a level with the table above, then to the closest level the model supports | | `temperature` above 2 | Limited to 2. See [Parameter Handling](https://silentapi.com/docs/openai#parameter-handling). | ``` curl https://api.silentapi.com/v1/messages \ -H "Content-Type: application/json" \ -H "x-api-key: YOUR_API_KEY" \ -d '{ "model": "claude-sonnet-5.5", "max_tokens": 4096, "thinking": {"type": "enabled", "budget_tokens": 4096}, "messages": [{"role":"user","content":"Compare two sorting algorithms."}] }' ``` ## Cross-Style Usage Use any supported text or multimodal model with the Anthropic Messages API. The response uses the Anthropic Messages format. ## Streaming Set `stream: true` to receive server-sent events (SSE) in the Anthropic Messages API format. See [Streaming](https://silentapi.com/docs/streaming) for the event sequence. Source: https://silentapi.com/docs/gemini # Gemini Style Use Gemini generateContent and streamGenerateContent SilentAPI provides endpoints compatible with the Gemini API under `/v1beta`. Point the Google GenAI SDK at SilentAPI and send your API key. ## Endpoints | Method | Path | Description | | --- | --- | --- | | POST | `/v1beta/models/{model}:generateContent` | Generate content | | POST | `/v1beta/models/{model}:streamGenerateContent` | Stream generate content | ## Basic Request ``` curl "https://api.silentapi.com/v1beta/models/gemini-3.8-flash:generateContent" \ -H "Content-Type: application/json" \ -H "x-goog-api-key: YOUR_API_KEY" \ -d '{ "contents": [{ "parts": [{ "text": "What is quantum entanglement?" }] }] }' ``` Response: ``` { "candidates": [{ "content": { "role": "model", "parts": [{ "text": "Quantum entanglement is a phenomenon..." }] }, "finishReason": "STOP" }], "usageMetadata": { "promptTokenCount": 6, "candidatesTokenCount": 142, "totalTokenCount": 148 }, "silentapi": { "cost": 0.000038, "fallback": null } } ``` ## Using the Google GenAI SDK ### Python ``` from google import genai client = genai.Client( api_key="YOUR_API_KEY", http_options={"base_url": "https://api.silentapi.com"} ) response = client.models.generate_content( model="gemini-3.8-flash", contents="What is quantum entanglement?" ) print(response.text) ``` ### JavaScript ``` import { GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({ apiKey: "YOUR_API_KEY", httpOptions: { baseUrl: "https://api.silentapi.com" } }); const response = await ai.models.generateContent({ model: "gemini-3.8-flash", contents: "What is quantum entanglement?" }); const responseText = response.text; ``` ## Supported Parameters | Parameter | Type | Description | | --- | --- | --- | | contents | array | Conversation turns with parts | | systemInstruction | object or string | System instruction. An object contains text parts. | | generationConfig | object | Supports temperature, topP, maxOutputTokens, stopSequences, and response schemas | | generationConfig.thinkingConfig.thinkingLevel | string | Reasoning level: `minimal`, `low`, `medium`, or `high`. A model without the level gets the closest level, for example `minimal` becomes `low` on `gemini-3.8-flash`. See [Reasoning](https://silentapi.com/docs/openai#reasoning). | | generationConfig.thinkingConfig.thinkingBudget | integer | Token budget for reasoning. See the table below. | | generationConfig.thinkingConfig.includeThoughts | boolean | `false` leaves out the thinking text. When absent, thinking text is returned when the model gives it. | | tools | array | Function declarations, Google Search, or Google Maps grounding | | toolConfig | object | Function calling configuration | | safetySettings | array | Safety filter configuration | ## Reasoning SilentAPI changes `thinkingBudget` to a reasoning level: | thinkingBudget | Reasoning level | | --- | --- | | Less than 0 | `medium` | | 0 | `none`. Reasoning is off on models that can turn it off. Other models use their lowest level. | | 1 to 2,048 | `low` | | 2,049 to 8,192 | `medium` | | 8,193 to 32,768 | `high` | | 32,769 to 65,536 | `xhigh` | | More than 65,536 | `max` | When both fields exist, `thinkingLevel` is used. An unknown `thinkingLevel` is ignored and `thinkingBudget` is used. Each model supports its own set of levels. SilentAPI changes an unsupported level to the closest supported level. See [Reasoning](https://silentapi.com/docs/openai#reasoning) for the rules. ### Parameter Handling | Request | Handling | | --- | --- | | `thinkingLevel` on a model with other levels | The closest level the model supports | | `thinkingBudget` on any model | Changed to a level with the table above, then to the closest level the model supports | | `temperature` above 2, `topP` above 1 | Limited to 2 and 1. See [Parameter Handling](https://silentapi.com/docs/openai#parameter-handling). | ## Grounding Use `tools` to request Google Search or Google Maps grounding. Support depends on the selected model. Grounding can add a request charge. Read current prices on the [Services page](https://silentapi.com/services) and [Calculator](https://silentapi.com/calculator). ``` curl "https://api.silentapi.com/v1beta/models/gemini-3.8-flash:generateContent" \ -H "Content-Type: application/json" \ -H "x-goog-api-key: YOUR_API_KEY" \ -d '{ "contents": [{ "parts": [{ "text": "What is the latest news on Mars exploration?" }] }], "tools": [{"googleSearch": {}}] }' ``` ## Cross-Style Usage Use any supported text or multimodal model with `generateContent`. The response uses the Gemini format. ## Streaming Use `:streamGenerateContent` to receive server-sent events (SSE). Each response chunk contains candidate parts. See [Streaming](https://silentapi.com/docs/streaming) for details. Source: https://silentapi.com/docs/streaming # Streaming Receive responses in real time as the model generates them Streaming sends model output as it is generated. You do not need to wait for the full response. Supported text and multimodal models can also stream function calls. ## Enabling Streaming Set `stream: true` for the OpenAI Chat Completions API or Anthropic Messages API. Use `streamGenerateContent` for Gemini. SilentAPI returns server-sent events (SSE). The Completions API and Responses API return a complete JSON response. They do not support streaming on SilentAPI. | API Style | How to Enable | | --- | --- | | OpenAI | `"stream": true` in request body | | Anthropic | `"stream": true` in request body | | Gemini | Use the `:streamGenerateContent` action | ## OpenAI Streaming Format When streaming through `/v1/chat/completions`, the response is a server-sent events (SSE) stream of OpenAI chat completion chunks. The stream ends with `data: [DONE]`. ``` curl -N https://api.silentapi.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "model": "gpt-6-sol", "messages": [{"role":"user","content":"Write a short poem about the ocean"}], "stream": true }' ``` Example events. Cost and usage values are examples: ``` data: {"id":"chatcmpl_abc","object":"chat.completion.chunk","created":1719584000,"model":"gpt-6-sol","choices":[{"index":0,"delta":{"content":"The"},"finish_reason":null}]} data: {"id":"chatcmpl_abc","object":"chat.completion.chunk","created":1719584000,"model":"gpt-6-sol","choices":[{"index":0,"delta":{"content":" ocean"},"finish_reason":null}]} data: {"id":"chatcmpl_abc","object":"chat.completion.chunk","created":1719584000,"model":"gpt-6-sol","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]} data: {"id":"chatcmpl_abc","object":"chat.completion.chunk","created":1719584000,"model":"gpt-6-sol","choices":[],"usage":{"prompt_tokens":8,"completion_tokens":45,"total_tokens":53},"silentapi":{"cost":0.000038,"fallback":null}} data: [DONE] ``` ### Usage and Cost The final chunk before `[DONE]` includes these fields: | Field | Meaning | | --- | --- | | silentapi.cost | Charge for the request, in credits | | silentapi.fallback | ID of the fallback model that served the request, or `null` | | usage | Token usage. Only present when the service reports usage. | ### Using the OpenAI SDK ``` from openai import OpenAI client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.silentapi.com/v1") stream = client.chat.completions.create( model="gpt-6-sol", messages=[{"role": "user", "content": "Write a poem"}], stream=True ) for chunk in stream: if chunk.choices and chunk.choices[0].delta.content is not None: print(chunk.choices[0].delta.content, end="") ``` ## Anthropic Streaming Format When streaming via `/v1/messages`, the response is an SSE stream with named events matching the Anthropic streaming specification. ``` curl -N https://api.silentapi.com/v1/messages \ -H "Content-Type: application/json" \ -H "x-api-key: YOUR_API_KEY" \ -d '{ "model": "claude-sonnet-5.5", "max_tokens": 1024, "messages": [{"role":"user","content":"Write a haiku about rain"}], "stream": true }' ``` The Anthropic Messages API sends these events in order: - `message_start`: Message metadata. - `content_block_start`: Starts a content block. - `content_block_delta`: Adds content to the block. - `content_block_stop`: Ends the content block. - `message_delta`: Stop reason and usage, with `silentapi.cost`. - `message_stop`: Ends the stream. ``` event: message_start data: {"type":"message_start","message":{"id":"msg_abc","type":"message","role":"assistant","content":[],"usage":{"input_tokens":7,"output_tokens":0}}} event: content_block_start data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Soft"}} event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" rain falls"}} event: content_block_stop data: {"type":"content_block_stop","index":0} event: message_delta data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"output_tokens":12},"silentapi":{"cost":0.000045,"fallback":null}} event: message_stop data: {"type":"message_stop"} ``` ### Tool Use Streaming A function call uses these events: | Event | Content | | --- | --- | | content_block_start | Starts the block. `content_block.type` is `tool_use`. | | content_block_delta | `delta.type` is `input_json_delta`. `delta.partial_json` contains part of the function input JSON. | | content_block_stop | Ends the block | ### Using the Anthropic SDK ``` import anthropic client = anthropic.Anthropic( api_key="YOUR_API_KEY", base_url="https://api.silentapi.com" ) with client.messages.stream( model="claude-sonnet-5.5", max_tokens=1024, messages=[{"role": "user", "content": "Write a haiku"}] ) as stream: for text in stream.text_stream: print(text, end="", flush=True) ``` ## Gemini Streaming Format When streaming through `:streamGenerateContent`, the response is a server-sent events (SSE) stream of Gemini response chunks. ``` curl -N "https://api.silentapi.com/v1beta/models/gemini-3.8-flash:streamGenerateContent" \ -H "Content-Type: application/json" \ -H "x-goog-api-key: YOUR_API_KEY" \ -d '{ "contents": [{ "parts": [{ "text": "Describe a sunset" }] }] }' ``` Each chunk contains candidate parts with incremental text: ``` data: {"candidates":[{"content":{"parts":[{"text":"The sun"}],"role":"model"}}]} data: {"candidates":[{"content":{"parts":[{"text":" dips below"}],"role":"model"}}]} data: {"candidates":[{"content":{"parts":[],"role":"model"},"finishReason":"STOP"}],"usageMetadata":{"promptTokenCount":4,"candidatesTokenCount":32,"totalTokenCount":36},"silentapi":{"cost":0.000021,"fallback":null}} ``` ### Using the Google GenAI SDK ``` from google import genai client = genai.Client( api_key="YOUR_API_KEY", http_options={"base_url": "https://api.silentapi.com"} ) response = client.models.generate_content_stream( model="gemini-3.8-flash", contents="Describe a sunset" ) for chunk in response: if chunk.text: print(chunk.text, end="") ``` ## Cross-Format Streaming SilentAPI translates between streaming formats. A request to `/v1/messages` returns Anthropic SSE events. | Request Endpoint | Model | Stream Format You Receive | | --- | --- | --- | | /v1/chat/completions | Supported text or multimodal model | OpenAI SSE | | /v1/messages | Supported text or multimodal model | Anthropic SSE | | :streamGenerateContent | Supported text or multimodal model | Gemini SSE | ## Billing During Streaming Streaming uses the same model prices as requests without streaming. The cost appears in `silentapi.cost` in the final event after successful completion. If a stream is interrupted, SilentAPI charges the reported usage. If usage is absent, it estimates input tokens and output tokens from the content received. A service failure before output or usage releases the hold. An interrupted stream can close before it sends the cost event. SilentAPI can use a fallback while it opens a stream. It cannot retry with another model after output starts. If the service fails during output, the stream ends. Source: https://silentapi.com/docs/fallbacks # Fallbacks Automatic model fallback when the primary model fails SilentAPI tries another route when the selected route fails. Enable cross-model fallbacks to try selected text models after a retryable error. ## How It Works - Request a model, for example `gpt-6-sol`. - If the model returns a retryable error, SilentAPI tries the next model. - The `silentapi` object names the model that served the request. - If every fallback fails, SilentAPI returns the last error. ## Checking If Fallback Was Used Every response includes a `silentapi` object: ``` "silentapi": { "cost": 0.000045, "fallback": "claude-sonnet-5.5", "model": "claude-sonnet-5.5", "model_name": "Claude Sonnet 5.5", "requested_model": "gpt-6-sol", "substituted": true, "notice": "GPT 6 Sol was unavailable, so SilentAPI served this request with Claude Sonnet 5.5." } ``` | Field | Type | Meaning | | --- | --- | --- | | cost | number | Charge in credits for the model that served the request | | fallback | string or null | ID of the fallback model that served the request, or `null` | | model | string | ID of the model that served the request | | model_name | string | Name of the model that served the request | | requested_model | string | Requested model ID. Only present when another model served the request. | | substituted | boolean | `true`. Only present when another model served the request. | | notice | string | Short text about the change. Only present when another model served the request. | ## Eligible Error Codes Fallback is triggered when the requested model returns one of these status codes: | Status | Reason | | --- | --- | | 401 | Authentication error (key rotation) | | 402 | Service payment or quota error | | 403 | Forbidden (key issue) | | 404 | Requested model unavailable on that route | | 408 | Request timeout | | 409 | Conflict | | 425 | Too early | | 429 | Rate limited | | 500+ | Server errors | | Timeout | The model did not respond in time | ## Custom Fallback Models Configure a cross-model fallback chain on the [Fallbacks page](https://silentapi.com/fallbacks). SilentAPI retries the request on the selected models after a retryable error. Set up to two preferred fallback models. SilentAPI tries the primary model, then the selected fallback models. If you select no models, it uses the account defaults. Cross-model fallbacks are disabled by default. Turn on `Enable cross-model fallbacks`, select models, and save. Fallbacks follow retryable service errors. Invalid requests such as 400 and 422 do not trigger them. Account key and balance errors do not trigger them. ## Streaming and Fallbacks SilentAPI selects the first available route before a stream starts. After the stream starts to send data, SilentAPI cannot retry the request with a different model. If you need fallbacks after output starts, do not set `stream: true`. Source: https://silentapi.com/docs/media # Media and OCR Image tools, file tools, OCR, moderation, music, and parameter handling File endpoints accept a multipart file upload or a JSON data URL. Moderation accepts text or chat messages. Music accepts a prompt and an optional image. Authenticate with your SilentAPI API key. | Limit | Value | | --- | --- | | Decoded input for file tools and OCR | 20 MB | | Image size for image conversion and SilentAPI image OCR | 12,000 pixels on each side | | Selected PDF pages for OCR | 50 pages | | Selected pages for Mistral OCR 4.1 | 1,000 pages | | Multipart file size | 25 MB per file | | Multipart file count | 8 files | | Multipart total size | 50 MB | Response values below are examples, not current prices. Base64 response strings show only part of the output. The `cost` field is in credits. See the [[ Services ]](https://silentapi.com/services) page or [[ Calculator ]](https://silentapi.com/calculator) for current prices. For JSON file requests, set `file` to a complete data URL. The examples use a variable with a small PNG: ``` IMAGE_DATA='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+aBZkAAAAASUVORK5CYII=' ``` ## Image Compress `POST /v1/images/compress` creates a smaller image and removes metadata by default. ``` curl https://api.silentapi.com/v1/images/compress \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@photo.png" \ -F "format=webp" \ -F "quality=75" \ -F "response_format=b64_json" ``` ``` curl https://api.silentapi.com/v1/images/compress \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"file\":\"$IMAGE_DATA\",\"format\":\"webp\",\"quality\":75,\"response_format\":\"b64_json\"}" ``` | Name | Type | Default | Rule | | --- | --- | --- | --- | | file | file or data URL | required | JPEG, PNG, WebP, GIF, or HEIC input | | format | string | webp | webp, jpeg, png, or avif | | quality | integer | 75 | 1 to 100 | | lossless | boolean | false | PNG or WebP only. WebP forces quality 100. | | stripMetadata | boolean | true | Remove metadata when supported | | maxWidth | integer | none | 1 to 12,000 pixels | | maxHeight | integer | none | 1 to 12,000 pixels | | response_format | string | binary | binary or b64_json | ``` { "object": "image", "data": [{ "b64_json": "UklGRg==", "mime_type": "image/webp" }], "width": 1600, "height": 900, "bytes_in": 842100, "bytes_out": 126400, "cost": 0.12 } ``` The default response is binary. Use `-o output.webp` with curl to save it. Read `X-SilentAPI-Cost` for the charge. Compression is charged per call. Input must fit the 20 MB and image dimension limits. See the [[ Services ]](https://silentapi.com/services) page for current prices. ## Image Convert `POST /v1/images/convert` changes an image to a selected format. The request fields and response shape match Image Compress. The `format` field is required. ``` curl https://api.silentapi.com/v1/images/convert \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@photo.png" \ -F "format=jpeg" \ -F "quality=82" \ -F "response_format=b64_json" ``` ``` curl https://api.silentapi.com/v1/images/convert \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"file\":\"$IMAGE_DATA\",\"format\":\"jpeg\",\"quality\":70,\"response_format\":\"b64_json\"}" ``` | Name | Type | Default | Rule | | --- | --- | --- | --- | | file | file or data URL | required | JPEG, PNG, WebP, GIF, or HEIC input | | format | string | required | webp, jpeg, png, or avif | | quality | integer | 82 for WebP, JPEG, and AVIF | 1 to 100. PNG leaves quality unset by default. | | lossless | boolean | false | Not available for jpeg or avif | | stripMetadata | boolean | true | Remove metadata when supported | | maxWidth | integer | none | 1 to 12,000 pixels | | maxHeight | integer | none | 1 to 12,000 pixels | | response_format | string | binary | binary or b64_json | ``` { "object": "image", "data": [{ "b64_json": "/9j/", "mime_type": "image/jpeg" }], "width": 1200, "height": 800, "bytes_in": 520000, "bytes_out": 98000, "cost": 0.12 } ``` Conversion is charged per call. Input must fit the 20 MB and image dimension limits. See the [[ Services ]](https://silentapi.com/services) page for current prices. ## Remove File Metadata `POST /v1/files/metadata/remove` removes metadata from images, PDF files, and Office files. ``` curl https://api.silentapi.com/v1/files/metadata/remove \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@document.pdf" \ -F "response_format=b64_json" ``` ``` curl https://api.silentapi.com/v1/files/metadata/remove \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"file\":\"$IMAGE_DATA\",\"response_format\":\"b64_json\"}" ``` | Name | Type | Default | Rule | | --- | --- | --- | --- | | file | file or data URL | required | JPEG, PNG, WebP, GIF, HEIC, PDF, DOCX, XLSX, or PPTX | | filename | string | file | Name for JSON file input | | response_format | string | binary | binary or b64_json | ``` { "object": "file", "data": [{ "b64_json": "JVBERi0=", "mime_type": "application/pdf" }], "removed": ["document-properties", "xmp"], "cost": 0.02 } ``` Input is limited to 20 MB. Encrypted PDF files are not supported. JPEG orientation and image color profiles can remain. HEIC input becomes JPEG. Office processing removes document properties and some author fields. It does not remove document content. Metadata removal is charged per call. A file conversion can add a transform charge. See the [[ Services ]](https://silentapi.com/services) page for current prices. ## OCR `POST /v1/ocr` reads text from images and documents. Set `model` to one of these values: | Model | Input | Page limit | | --- | --- | --- | | silentapi-ocr | Images and PDF files. English OCR data. | 50 selected pages | | vision-document-text-detection | One image per call (Google Cloud Vision Document Text Detection). No PDF input. | One image | | mistral-ocr-4-1 | Images and documents | 1,000 selected pages | ``` curl https://api.silentapi.com/v1/ocr \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@scan.pdf" \ -F "model=silentapi-ocr" \ -F "outputFormat=blocks" \ -F "pages=1-3" ``` ``` curl https://api.silentapi.com/v1/ocr \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"file\":\"$IMAGE_DATA\",\"model\":\"silentapi-ocr\",\"outputFormat\":\"text\"}" ``` ### OCR OCR supports images and PDF files. It uses English OCR data and allows up to 50 selected pages. | Name | Type | Default | Rule | | --- | --- | --- | --- | | file | file or data URL | required | JPEG, PNG, WebP, GIF, HEIC, or PDF | | model | string | silentapi-ocr | silentapi-ocr | | outputFormat | string | text | text or blocks | | pages | array or range | all | Up to 50 pages, for example [1,2] or 1-3 | | Page selection | Example | Rule | | --- | --- | --- | | Range | `1-3` | Page numbers start at 1 | | Array | `[1,3]` | Each page number must be unique | Selected pages must exist. Use `output_format` as an alternative to `outputFormat`. ``` { "object": "ocr", "model": "silentapi-ocr", "pages": [{ "page": 1, "text": "Example text", "source": "ocr" }], "usage": { "pages": 1, "ocrPages": 1, "cpuMs": 215 }, "cost": 0.17 } ``` The `source` field shows how SilentAPI read each page: | Value | Meaning | | --- | --- | | text-layer | The PDF page has enough embedded text. SilentAPI returns that text. | | ocr | The page is scanned or is an image. SilentAPI reads it with OCR. | Blocks can include these fields: | Field | Type | Meaning | | --- | --- | --- | | text | string | Text of the block | | bbox | object | Block box with `x0`, `y0`, `x1`, and `y1` | | confidence | number | Recognition confidence | Charges use pages, OCR pages, and image transforms. See the [[ Services ]](https://silentapi.com/services) page for current prices. ### Google Cloud Vision Document Text Detection Document Text Detection is Google Cloud Vision's text reader for dense text and documents. On `POST /v1/ocr`, set `model` to `vision-document-text-detection` to get the same OCR response shape as the other models. It reads one image per call (JPEG, PNG, WebP or GIF, up to 20 MB); PDF input is not supported. The older model name `google-ocr` still works. For the full Google Cloud Vision response, call `POST /v1/google/vision-document-text-detection`, or `vision-text-detection` for short text in photos. ``` curl https://api.silentapi.com/v1/ocr \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@scan.png" \ -F "model=vision-document-text-detection" \ -F "outputFormat=blocks" ``` ### Mistral OCR 4.1 Mistral OCR 4.1 reads images and documents. Input is limited to 20 MB. Page selection uses numbers from 1 to 1,000. Provider limits also apply. ``` curl https://api.silentapi.com/v1/ocr \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@scan.pdf" \ -F "model=mistral-ocr-4-1" \ -F "pages=1-3" \ -F "outputFormat=markdown" \ -F "table_format=markdown" ``` ``` curl https://api.silentapi.com/v1/ocr \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"file\":\"$IMAGE_DATA\",\"model\":\"mistral-ocr-4-1\",\"outputFormat\":\"blocks\",\"include_image_base64\":false}" ``` | Name | Type | Default | Rule | | --- | --- | --- | --- | | file | file or data URL | required | Image or document input | | model | string | silentapi-ocr | Set to mistral-ocr-4-1 | | pages | array or range | all | Valid pages, with up to 1,000 selected by the API | | outputFormat | string | text | text, markdown, or blocks | | table_format | string | provider default | markdown or html | | extract_header | boolean | provider default | Request document headers when true | | extract_footer | boolean | provider default | Request document footers when true | | include_image_base64 | boolean | provider default | Request page images when true | | confidence_scores_granularity | string | none | page, block, or word | | document_annotation_format | object | none | type: json_schema, with json_schema.schema | | bbox_annotation_format | object | none | type: json_schema, with json_schema.schema | | document_annotation_prompt | string | none | Requires document_annotation_format, maximum 4,000 characters | ``` { "object": "ocr", "model": "mistral-ocr-4-1", "pages": [{ "page": 1, "markdown": "# Example document", "images": [] }], "usage": { "pages": 1 }, "cost": 0.8 } ``` Each page has `page` and `markdown`. The other fields appear when the response includes them: | Field | Meaning | | --- | --- | | page | Page number, starting at 1 | | markdown | Page text in Markdown. Mistral OCR returns it even when you select `text`. | | blocks | Text blocks. Select `blocks` to request them. | | tables | Tables on the page | | images | Images on the page, with `id`, `bbox`, `image_base64`, and `image_annotation` when present | | header | Page header | | footer | Page footer | | dimensions | Page dimensions | | confidence_scores | Confidence scores | A `document_annotation` field can appear at the top level of the response. Mistral OCR is charged per OCR page. Annotation options use the annotated page rate. See the [[ Services ]](https://silentapi.com/services) page for current prices. ## Moderation `POST /v1/moderations` checks text or chat messages with `mistral-moderation-2603`, also named Mistral Moderation 2. ``` curl https://api.silentapi.com/v1/moderations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"mistral-moderation-2603","input":["Example text to check"]}' ``` ``` curl https://api.silentapi.com/v1/moderations \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "model=mistral-moderation-2603" \ -F "input=Example text to check" ``` Moderation does not accept a file upload or data URL as media input. Use `input` for text, or `messages` for chat. When both exist, `messages` is used. | Name | Type | Default | Rule | | --- | --- | --- | --- | | model | string | mistral-moderation-2603 | mistral-moderation-2603 | | input | string or array | required without messages | Up to 32 nonempty text values and 400,000 combined characters | | messages | array | none | Nonempty array. Roles: system, user, assistant, tool. Content must be text. Maximum 400,000 combined characters. | ``` { "id": "modr-12345678-1234-4234-8234-123456789012", "model": "mistral-moderation-2603", "results": [{ "flagged": false, "categories": { "hate": false }, "category_scores": { "hate": 0.01 } }], "cost": 0.0203 } ``` Category names depend on the model response. Successful moderation calls have a call charge and an input token charge. Shared service and account media limits apply. See [[ Rate Limits ]](https://silentapi.com/docs/rate-limits) and the [[ Services ]](https://silentapi.com/services) page for current prices. ## Music `POST /v1/audio/music` creates music with `lyria-3-pro` or `lyria-3-clip`. The default is `lyria-3-clip`. ``` curl https://api.silentapi.com/v1/audio/music \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"model\":\"lyria-3-clip\",\"prompt\":\"A quiet electronic morning\",\"image\":\"$IMAGE_DATA\",\"response_format\":\"wav\"}" ``` ``` curl https://api.silentapi.com/v1/audio/music \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "prompt=A quiet electronic morning" \ -F "model=lyria-3-clip" \ -F "image=@reference.png" ``` | Name | Type | Default | Rule | | --- | --- | --- | --- | | model | string | lyria-3-clip | lyria-3-pro or lyria-3-clip | | prompt | string | required | Nonempty music description. input is an alternative. | | image | data URL, HTTPS URL, or file | none | Optional image input | | image_url | data URL or HTTPS URL | none | Optional image input | | response_format | string | model default | wav, pcm, flac, mp3, opus, or aac. See [Music options](#music-options). | ``` { "object": "music", "created": 1770000000, "data": [{ "b64_json": "UklGRg==", "mime_type": "audio/wav", "lyrics": null }], "silentapi": { "cost": 4, "fallback": null, "model": "lyria-3-clip", "model_name": "Lyria 3 Clip" } } ``` Music always returns JSON with base64 audio. The output media type can depend on the route that served the request. Lyrics can be `null`. There is no binary response option. | Limit | Value | | --- | --- | | Upload file size | 25 MB per file | | Upload file count | 8 files. Only the first image file is used. | | Upload total size | 50 MB | | JSON data URL input | 50 MB decoded, the standard media limit | The file tool dimension limit does not apply to this endpoint. Music is charged per generation. See the [[ Services ]](https://silentapi.com/services) page for current prices. ## Parameter Handling Each model accepts its own set of options. When you send a valid OpenAI style option that the model does not support, SilentAPI changes it instead of failing the request. It converts the output, uses the closest value the model supports, or leaves out an option that has no effect. SilentAPI does not send a value that the model rejects. | Action | Meaning | | --- | --- | | Convert | SilentAPI changes the output, for example PCM audio to a WAV file. | | Closest value | SilentAPI uses the nearest supported value, for example 1792x1024 becomes the 16:9 aspect ratio. | | Ignore | SilentAPI does not send the option, because the model has no such control. | Audio responses have the `X-SilentAPI-Format` header. It shows the real format of the audio, for example `wav`. The `Content-Type` header matches it. ### Speech `POST /v1/audio/speech` accepts `response_format` values `mp3`, `wav`, `opus`, `aac`, `flac`, and `pcm` on every speech model. | Model | Formats you get | Other requests | | --- | --- | --- | | voxtral-mini-tts | mp3, wav, pcm | opus and aac return mp3. flac returns wav. | | gemini-3.8-flash-tts | wav, pcm | mp3, opus, aac, and flac return wav. | | gemini-3.8-flash-lite-tts | wav, pcm | mp3, opus, aac, and flac return wav. | When you do not send `response_format`, Voxtral returns mp3 and Gemini returns wav. SilentAPI makes WAV files from PCM audio by adding a WAV header. The audio does not change. PCM output is raw signed 16 bit samples, little endian, mono. The `Content-Type` gives the sample rate, for example `audio/pcm;rate=24000;channels=1`. ``` curl https://api.silentapi.com/v1/audio/speech \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"voxtral-mini-tts","input":"Your request is ready.","voice":"en_paul_neutral","response_format":"wav"}' \ -D headers.txt \ -o speech.wav ``` | Option | Handling | | --- | --- | | voice | Voice names match without case. An unknown voice, for example an OpenAI voice name such as `alloy`, uses the model default voice. | | speed | Sent as a number from 0.25 to 4. SilentAPI changes other values to the nearest end of this range. Models without speed control ignore it. | | Model | Default voice | Voices | | --- | --- | --- | | voxtral-mini-tts | en_paul_neutral | en_paul_neutral, en_paul_happy, en_paul_sad, en_paul_frustrated, en_paul_excited, en_paul_confident, en_paul_cheerful, en_paul_angry, gb_oliver_neutral, gb_oliver_sad, gb_oliver_excited, gb_oliver_curious, gb_oliver_confident, gb_oliver_cheerful, gb_oliver_angry, gb_jane_neutral, gb_jane_sarcasm, gb_jane_confused, gb_jane_shameful, gb_jane_sad, gb_jane_jealousy, gb_jane_frustrated, gb_jane_curious, gb_jane_confident, fr_marie_neutral, fr_marie_sad, fr_marie_happy, fr_marie_excited, fr_marie_curious, fr_marie_angry | | gemini-3.8-flash-tts, gemini-3.8-flash-lite-tts | Kore | Zephyr, Puck, Charon, Kore, Fenrir, Leda, Orus, Aoede, Callirrhoe, Autonoe, Enceladus, Iapetus, Umbriel, Algieba, Despina, Erinome, Algenib, Rasalgethi, Laomedeia, Achernar, Alnilam, Schedar, Gacrux, Pulcherrima, Achird, Zubenelgenubi, Vindemiatrix, Sadachbia, Sadaltager, Sulafat | ### Transcription `POST /v1/audio/transcriptions` accepts every `response_format` below on every speech to text model. SilentAPI builds the requested shape from the model output. | response_format | Result | | --- | --- | | json | Default. JSON with `text` and the cost fields. | | text | Plain text | | verbose_json | JSON with `task`, `language` when known, `duration`, `text`, and `segments`. `words` appears when the model gives word times. | | srt | SubRip subtitles | | vtt | WebVTT subtitles | Voxtral Mini Transcribe gives a time for each segment. Gemini 3.5 Transcribe gives segment times for some requests. GPT Transcribe gives text only. When the model gives no times, SilentAPI returns one segment or one subtitle for the full audio. Its end time is the audio length. The length is exact for WAV files and estimated from the file size for other formats. The `text`, `srt`, and `vtt` formats return no JSON. Read the charge in the `X-SilentAPI-Cost` header. An unknown `response_format` returns `json`. SilentAPI sends `language`, `prompt`, and `temperature` to the model when you send them. ``` curl https://api.silentapi.com/v1/audio/transcriptions \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@recording.mp3" \ -F "model=voxtral-mini-transcribe" \ -F "response_format=srt" ``` ### Image Generation `POST /v1/images/generations` and `POST /v1/images/edits` change these options to fit the model: | Option | Handling | | --- | --- | | size | SilentAPI uses the closest aspect ratio and image size the model supports. For example, `1792x1024` becomes 16:9 at 1K on `grok-imagine-image-2.0`. | | aspect_ratio | Used when the model supports it. Otherwise SilentAPI uses the closest supported ratio. `aspect_ratio` wins over `size`. | | image_size or resolution | 0.5K, 1K, 2K, or 4K. SilentAPI uses the closest size the model supports. It wins over the size in `size`. | | n | 1 to 4. A model that makes one image per call gets one call for each image. If a later call fails, you get the images that were made and pay only for them. | | response_format | `b64_json` is the default. With `url`, you get a data URL, for example `data:image/png;base64,...`, because the models return image data and not a link. | | output_format | png, jpeg, or webp. When the model returns another format, SilentAPI converts the image. Each converted image adds the Image Convert price. `output_compression` sets the quality for jpeg and webp. If a conversion fails, you get the original image. `mime_type` shows the real format. | | quality, background, style | Ignored by models without these controls | | Model | Aspect ratios | Image sizes | | --- | --- | --- | | gemini-3.1-flash-image | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1 | 0.5K, 1K, 2K, 4K | | gemini-3.1-flash-lite-image | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 | 1K | | grok-imagine-image-2.0 | 1:1, 3:4, 4:3, 9:16, 16:9, 2:3, 3:2, 9:19.5, 19.5:9, 9:20, 20:9, 1:2, 2:1 | 1K, 2K | GPT Image models make all `n` images in one call and change these options: | Option | Handling | | --- | --- | | size | A pixel size such as `1536x1024` goes to the model as you send it. The model uses the closest size it supports. A size tier such as `2K` sets the image size. | | aspect_ratio, image_size, or resolution | When you send one of these with a pixel size, SilentAPI sends the closest aspect ratio and the closest image size (512, 768, 1K, 1.5K, 2K, or 4K) instead of the pixel size. | | quality | auto, low, medium, or high. `standard` becomes medium. `hd`, `xhigh`, and `max` become high. | | background | auto, transparent, or opaque. Use png or webp for a transparent background. | | output_format | The model makes png, jpeg, and webp directly, at no extra cost. Other formats use the conversion above. | | output_compression | 0 to 100, for jpeg and webp | | seed | An integer. The same seed and options give a similar image, but the result can change. | | Input images | Up to 16 images from `image`, `images`, `image_url`, or uploaded files guide the new image. | ### Music | response_format | Result | | --- | --- | | wav | WAV audio | | pcm | Raw PCM from the WAV output. `mime_type` gives the sample rate and channels. | | flac | WAV audio, the closest lossless format | | mp3, opus, aac, or absent | The model default format, usually mp3 | The `X-SilentAPI-Format` header and `mime_type` show the real format. Music models have no length control, so SilentAPI does not send `duration` or `seconds`. Lyria 3 Clip makes short clips. For Lyria 3 Pro, write the length you want in the prompt. ### Video Video requests never fail because an option is outside what a model offers. SilentAPI uses the closest supported value: - `duration` (or `seconds`) becomes a whole number of seconds inside the model's range, for example 30 becomes 15 on a model that allows 1 to 15 seconds. - `resolution` (or `size` as `WIDTHxHEIGHT`) uses the nearest supported resolution, for example 1080p becomes 720p on a model that stops at 720p. - `aspect_ratio` uses the nearest supported ratio; a `size` such as `1080x1920` also sets the ratio. - The credit hold and the charge use the same adjusted values, so you pay for the video you get. ### Embeddings `POST /v1/embeddings` accepts `encoding_format` `float` (default) or `base64` on every model. SilentAPI gets the float vector and makes the base64 string itself. The string holds 32 bit floats, little endian, the same layout as the OpenAI API. | Model | Full size | dimensions | | --- | --- | --- | | text-embedding-3-small | 1,536 | Sent to the model | | text-embedding-3-large | 3,072 | Sent to the model | | gemini-embedding-2 | 3,072 | Sent to the model | | qwen3-embedding-8b | 4,096 | Sent to the model | | codestral-embed-2505 | 1,536 | SilentAPI keeps the first values and scales the vector to length 1. This is the shortening method for this model family. | | mistral-embed-2312 | 1,024 | Not supported. You get the full vector. | A `dimensions` value that is equal to or larger than the full size returns the full vector. A value that is not a whole number above 0 is ignored. Source: https://silentapi.com/docs/billing # Billing & Credits Request charges and credit holds SilentAPI uses prepaid credits. Add credits to your account before you send paid requests. Each request charges the credits used by the service. ## Credits One credit equals $0.01 USD. This means 100 credits equals $1.00. Credits never expire. | Credits | USD Value | | --- | --- | | 1 | $0.01 | | 100 | $1.00 | | 1,000 | $10.00 | | 10,000 | $100.00 | ## Token Billing Text and multimodal models charge per token. Token counts depend on the model and input. Each model has input and output prices: - Input price: Cost per input token. - Output price: Cost per output token. For text without caching or extra services, the cost is `(input_tokens * input_price) + (output_tokens * output_price)`. ### Example Read current prices in credits on the [Services page](https://silentapi.com/services) or [Calculator](https://silentapi.com/calculator). Multiply each token count by its price per token. ``` Input cost: input tokens * current input price Output cost: output tokens * current output price Total cost: input cost + output cost ``` ## Other Billing Units The billing unit depends on the service: - Image generation uses image tokens or a price per image, depending on the model. - Google Cloud Vision detection services charge per call. - Crypto Price and SilentAPI lookup services charge per call. - OCR charges use pages or calls, depending on the model. Annotation options can change the page rate. - Speech services use tokens, characters, or audio minutes, depending on the model. - Music services charge per generation. Video services charge per second at the selected resolution. ## Reasoning Tokens Models with thinking can generate reasoning tokens. These tokens count toward the output charge. | API | Usage field | | --- | --- | | OpenAI Chat Completions API | `usage.completion_tokens_details.reasoning_tokens` | | Responses API | `usage.output_tokens_details.reasoning_tokens` | | Gemini | `usageMetadata.thoughtsTokenCount` | Set the reasoning level with `reasoning_effort`. See [Reasoning](https://silentapi.com/docs/openai#reasoning). ## Cached Input Cached input can have a separate price. Cache writes can also have a separate price. Support depends on the model and its response usage. SilentAPI applies the reported cache read and write token counts without charging those tokens twice. Read current rates on the [Services page](https://silentapi.com/services) and [Calculator](https://silentapi.com/calculator). ## Long Context Pricing Some models have a higher rate for long input. SilentAPI applies that rate from 99% of the published token threshold. Read the rates and threshold on the [Services page](https://silentapi.com/services). ## Checking Your Balance Read your balance on the [Dashboard](https://silentapi.com/dashboard). You can also request it through the API: ``` curl https://api.silentapi.com/v1/silentapi/balance \ -H "Authorization: Bearer YOUR_API_KEY" ``` ``` { "success": true, "credits": 428.55 } ``` ## Cost in Responses Successful model responses include `silentapi.cost` in credits. The values below are examples: ``` "silentapi": { "cost": 0.00146, "fallback": null } ``` | Response | Where to read the cost | | --- | --- | | Model response | `silentapi.cost` | | Streaming response | `silentapi.cost` in the final SSE chunk before the stream closes | | File tools and OCR | Top-level `cost` field | | Binary response | `X-SilentAPI-Cost` header | ## Insufficient Credits SilentAPI checks your available balance before a paid request starts. Existing holds reduce the credits available for new requests. | Request | Before the request | After the request | | --- | --- | --- | | Paid model request | SilentAPI holds the estimated maximum cost. The estimate includes the selected model and eligible fallback models. | SilentAPI charges the real cost when the request completes. It releases the hold in the same operation. | | Fixed-price service, such as IP lookup, email lookup, or crypto price | No hold. SilentAPI checks that the available balance covers the price. | SilentAPI charges the price when the request completes. | If the available balance cannot cover the hold, the request fails with HTTP `402`. SilentAPI releases the hold if the request fails before billable usage. ## Adding Credits Add credits on the [Recharge page](https://silentapi.com/recharge). Read the supported cryptocurrency payment options on [Payment Methods](https://silentapi.com/payment). Source: https://silentapi.com/docs/errors # Error Codes HTTP status codes and error responses SilentAPI returns HTTP status codes. Error responses follow the format of the request endpoint. ## HTTP Status Codes | Code | Meaning | What to Do | | --- | --- | --- | | 200 | Success | Process the response | | 400 | Bad request | Check the request body, model name, and parameters | | 401 | Missing API key | Send your API key in an accepted header | | 402 | Insufficient credits | Add credits or increase the API key budget | | 403 | Forbidden | API access may be disabled for your account | | 404 | Service not found | The model ID does not exist | | 413 | Input too large | Reduce the request size or image dimensions | | 415 | Unsupported media type | Use application/json or multipart/form-data | | 422 | Input rejected | Check the file, encryption, and request parameters | | 429 | Rate limited | Wait and retry, or reduce request frequency | | 500 | Internal error | Retry the request, contact support if it persists | | 502 | Service error | The model returned an error, fallback may apply | | 503 | Service unavailable | The service is temporarily disabled or overloaded | ## Error Response Formats ### OpenAI Style ``` { "error": { "message": "Insufficient credits", "type": "silentapi_error" } } ``` ### Anthropic Style ``` { "type": "error", "error": { "type": "api_error", "message": "Insufficient credits" } } ``` ### Gemini Style ``` { "error": { "code": 402, "message": "Insufficient credits", "status": "SILENTAPI_ERROR" } } ``` ## Common Error Messages | Message | Cause | | --- | --- | | Insufficient credits | The balance cannot cover the request or is zero. | | This model doesn't exist. | The model ID is unknown and has no compatible match. | | Prompt is required. | The request prompt is missing. | | This account has reached its internal safety limit. Please contact contact@silentapi.com if you need this raised. | The account API minute limit was reached. | | This API key has reached its monthly budget. | The key budget was reached. Change it on the Keys page. | | This service is temporarily disabled. | Select another service. | | The service is busy. Try again shortly. | The service or a shared quota is busy. A 429 response can include `Retry-After`. | | The service could not complete the request. Try again shortly. | The service failed during the request. | | The request was not accepted. Check the parameters and try again. | The request has invalid parameters. | | The request is too large. | The request is larger than the endpoint allows. | | The request was blocked by a content filter. | The request was blocked by a content filter. | | The input is longer than the model context. | The input is longer than the model context. | | Please wait before trying again | An account media operation limit was reached. | | API key is required | No accepted API key was sent. | | Invalid API key | The API key is not valid. | | API key has expired | The key has passed its expiry date. | | API key is disabled | The key is disabled. | | API access is disabled for this account. | API access is disabled. | | Insufficient credits for the requested maximum usage. | The balance cannot cover the request hold. | | This model is not available right now. | The model has no active price. | | Service is not configured. | The service cannot accept requests. | | Request body is not valid JSON. | Correct the JSON body. | | Request body is too large. | Reduce the encoded request body. | | Request body is not valid form data. | Correct the multipart form. | | A file is required. | Send a file, data URL, or supported HTTPS URL. | | Image format is required. | Set format for image conversion. | | Input is required. | Send nonempty moderation input. | | This model does not support OCR. | Select an OCR model. | | This model does not support moderation. | Select a moderation model. | | This model does not create music. | Select a music model. | | The lookup service is unavailable. | Retry after the wait time in Retry-After. | | Enter a valid IP address. | The lookup IP address is invalid. | | Enter a valid email address. | The email lookup input is missing. | | Too many requests. Try again in one minute. | The status endpoint limit was reached. Wait 60 seconds. | | Case | Status | Notes | | --- | --- | --- | | The service is busy | 429 | Includes `Retry-After: 5` | | A shared service quota is reached | 429 | `Retry-After` gives the wait time of that quota | | An account limit is reached | 429 | `Retry-After` can be absent | | The service rejects the input | 400 or 422 | Check the request parameters | | The input is too large | 413 | Reduce the request size | | Content filter or context error | Mapped from the failed request | The message names the cause | SilentAPI does not return error details from the service. ## Old Model IDs Supported old model IDs use a configured replacement or model family match. An unknown ID with no match returns 404. The response names the model that served the request. The response tells you when this happens: ``` "silentapi": { "cost": 0.0412, "fallback": null, "model": "gpt-image-2.5-flare", "model_name": "GPT Image 2.5 Flare", "requested_model": "stable-image-ultra", "substituted": true, "notice": "stable-image-ultra is no longer offered. SilentAPI served this request with GPT Image 2.5 Flare, the closest current model." } ``` These headers carry the same facts: | Header | Meaning | | --- | --- | | X-SilentAPI-Model | ID of the model that served the request | | X-SilentAPI-Substituted-For | Requested model ID. Only present when another model served the request. | Audio responses have no JSON body, so read the headers there. See [Fallbacks](https://silentapi.com/docs/fallbacks) for each field of the `silentapi` object. A 404 means the ID has no close match. Check the [Services page](https://silentapi.com/services) for the current list. ## Media Error Messages Media endpoints can return these fixed messages: | Message | Meaning | | --- | --- | | Forbidden. | Internal media authentication failed. | | The input is not valid. | The request body or method is not valid. | | The media options are not valid. | An option has the wrong type or value. | | The file is too large. | The file or image dimensions exceed the limit. | | This input format is not supported. | The file type is not supported. | | The file could not be processed. | The media parser could not read the file. | | Encrypted files are not supported. | The file is encrypted. | | Lossless output is not available for this format. | The selected output format cannot be lossless. | | Only English is available for this OCR model. | OCR accepts English OCR data only. | | The page selection is not valid. | The page list or range is invalid. | | A maximum of 50 pages is allowed. | The selected OCR pages exceed the limit. | | The media service could not complete the request. | An internal media failure occurred. | Source: https://silentapi.com/docs/rate-limits # Rate Limits Request limits and how they work SilentAPI applies rate limits to protect the platform. The limit depends on your balance or action. ## API Request Limits AI model endpoints use an account limit based on your credit balance: | Balance | Requests per Minute | | --- | --- | | 0 to 100 credits | 1,000 | | More than 100, up to 10,000 credits | 10,000 | | More than 10,000, up to 100,000 credits | 100,000 | | More than 100,000 credits | No account API minute limit | When you exceed this limit, the API returns `429`: ``` { "error": "This account has reached its internal safety limit. Please contact contact@silentapi.com if you need this raised." } ``` ## Media Operation Limits Image compression, image conversion, metadata removal, OCR, and moderation share these limits per account. All windows apply at the same time. These limits do not increase with your balance. | Window | Requests | | --- | --- | | 10 seconds | 20 | | 1 minute | 300 | | 1 hour | 5,000 | The account API minute limit also applies. A media operation limit returns `429` with `Please wait before trying again`. Mistral OCR and Mistral Moderation also have shared service limits: | Service | Requests per second | Requests per minute | Estimated input tokens per minute | | --- | --- | --- | --- | | Mistral OCR | 20 | 1,250 | No token limit | | Mistral Moderation | 8 | 500 | 2,000,000 | A shared limit returns `429` with `The service is busy. Try again shortly.` and a `Retry-After` header. ## Status Endpoint Limits `GET /status` and `GET /status/history` allow 60 requests per minute for each address. More requests return `429` with `Retry-After: 60`. See [Overview](https://silentapi.com/docs/overview) for the status endpoints. ## Account Action Limits Account changes have separate limits per user. Some action limits are reduced when your balance is below 1 credit. Two-factor management, challenge, and verification limits do not depend on your balance. ## Handling Rate Limits When the API returns `429`, retry with backoff: - Use the wait time in `Retry-After` when it is present - If the header is absent, wait 1 second before retrying - If still limited, wait 2 seconds - If still limited, wait 4 seconds - Continue doubling up to 60 seconds. - Contact [contact@silentapi.com](mailto:contact@silentapi.com) if you need a higher limit. Streaming requests have the same rate limits as other requests. Each streaming request counts as one request against your per-minute limit. The time that the stream stays open does not change this. ## Comparisons - [All comparisons](https://silentapi.com/alternatives): Private AI services and AI API providers compared. - [SilentAPI alternatives](https://silentapi.com/alternatives/silentapi): The main alternatives to SilentAPI. - [OpenRouter alternatives](https://silentapi.com/alternatives/openrouter): SilentAPI and OpenRouter compared on signup, payment, Monero, logging, and Tor access. - [NanoGPT alternatives](https://silentapi.com/alternatives/nanogpt): SilentAPI and NanoGPT compared on signup, payment, Monero, logging, and Tor access. - [PayPerQ alternatives](https://silentapi.com/alternatives/payperq): SilentAPI and PayPerQ compared on signup, payment, Monero, logging, and Tor access. - [Venice.ai alternatives](https://silentapi.com/alternatives/venice): SilentAPI and Venice.ai compared on signup, payment, Monero, logging, and Tor access. - [Tinfoil alternatives](https://silentapi.com/alternatives/tinfoil): SilentAPI and Tinfoil compared on signup, payment, Monero, logging, and Tor access. - [Duck.ai alternatives](https://silentapi.com/alternatives/duck-ai): SilentAPI and Duck.ai compared on signup, payment, Monero, logging, and Tor access. - [Proton Lumo alternatives](https://silentapi.com/alternatives/proton-lumo): SilentAPI and Proton Lumo compared on signup, payment, Monero, logging, and Tor access.