# Create Speech Source: https://docs.voidai.app/api-reference/audio/speech Generate speech through VoidAI with supported text-to-speech models, voices, speed controls, and binary audio responses. `POST https://api.voidai.app/v1/audio/speech` Requires [authentication](/authentication) and a model that advertises this endpoint. | Field | Type | Description | | - | - | - | | `model` | string, required | A supported speech model, such as `tts-1`. | | `input` | string, required | Text to speak. Provider limits may apply. | | `voice` | string, required | `alloy`, `echo`, `fable`, `onyx`, `nova`, or `shimmer`. | | `response_format` | string | `mp3`, `opus`, `aac`, `flac`, `wav`, or `pcm`; provider support varies. | | `speed` | number | Between 0.25 and 4.0. | ```bash theme={null} curl https://api.voidai.app/v1/audio/speech \ -H "Authorization: Bearer $VOIDAI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"model":"tts-1","input":"Hello from VoidAI.","voice":"alloy","response_format":"mp3"}' \ --output speech.mp3 ``` The response is binary audio. The gateway currently labels the response `audio/mpeg` with the filename `speech.mp3`, including when another format is requested; do not use that header alone to infer the encoding. Check [models and pricing](https://voidai.app/models) before making requests. # Create Transcription Source: https://docs.voidai.app/api-reference/audio/transcriptions Transcribe an audio file with VoidAI, including multipart upload limits and supported response-format parameters. `POST https://api.voidai.app/v1/audio/transcriptions` Requires [authentication](/authentication). Send `multipart/form-data` with a non-empty `file`, at most **25 MiB** (26,214,400 bytes). Choose a model that advertises this endpoint; the default model is `whisper-1`. | Field | Type | Description | | - | - | - | | `file` | file, required | Audio to process. Accepted encodings depend on the selected model/provider. | | `model` | string | Exact model ID; defaults to `whisper-1`. | | `prompt` | string | Optional context. | | `response_format` | string | `json` (default), `text`, `srt`, `verbose_json`, or `vtt`. | | `temperature` | number | The gateway accepts values from 0 to 2; the selected provider may impose narrower limits. | | `language` | string | Optional source-language hint for transcription. | ```bash theme={null} curl https://api.voidai.app/v1/audio/transcriptions \ -H "Authorization: Bearer $VOIDAI_API_KEY" \ -F model=whisper-1 \ -F file=@audio.mp3 \ -F response_format=json ``` For the JSON format, read the transcript from `text`. Output format and translation behavior depend on the selected model/provider. Consult [models and current prices](https://voidai.app/models). # Create Translation Source: https://docs.voidai.app/api-reference/audio/translations Submit audio to the VoidAI translation endpoint with multipart upload limits and supported parameters. `POST https://api.voidai.app/v1/audio/translations` Requires [authentication](/authentication). Send `multipart/form-data` with a non-empty `file`, at most **25 MiB** (26,214,400 bytes). Choose a model that advertises this endpoint; the default model is `whisper-1`. | Field | Type | Description | | - | - | - | | `file` | file, required | Audio to process. Accepted encodings depend on the selected model/provider. | | `model` | string | Exact model ID; defaults to `whisper-1`. | | `prompt` | string | Optional context. | | `response_format` | string | `json` (default), `text`, `srt`, `verbose_json`, or `vtt`. | | `temperature` | number | The gateway accepts values from 0 to 2; the selected provider may impose narrower limits. | ```bash theme={null} curl https://api.voidai.app/v1/audio/translations \ -H "Authorization: Bearer $VOIDAI_API_KEY" \ -F model=whisper-1 \ -F file=@audio.mp3 \ -F response_format=json ``` For the JSON format, read the transcript from `text`. Output format and translation behavior depend on the selected model/provider. Consult [models and current prices](https://voidai.app/models). # Create Chat Completion Source: https://docs.voidai.app/api-reference/chat/completions Send OpenAI-compatible chat requests to VoidAI, including streaming, tool calls, and model-supported multimodal inputs. `POST https://api.voidai.app/v1/chat/completions` Requires [authentication](/authentication). Choose a model that advertises `/v1/chat/completions`; access also depends on your account and balance. ## Request | Field | Type | Description | | - | - | - | | `model` | string, required | Exact model ID from the [catalog](/api-reference/models/list). | | `messages` | array, required | Conversation messages. Roles include `system`, `developer`, `user`, `assistant`, `tool`, and `function`. | | `stream` | boolean | Return server-sent events when supported. | | `stream_options.include_usage` | boolean | Request usage in the stream. | | `max_tokens` / `max_completion_tokens` | number | Positive output-token limit; support depends on the model. | | `temperature` | number | Sampling parameter; support depends on the model. | | `tools`, `tool_choice` | array / string or object | Tool definitions and selection for models that support them. | | `response_format` | object | `type` is `text` or `json_object`, subject to model support. | | `reasoning_effort` | string | `off`, `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`, where supported. | Message content can be text or content parts such as `text` and `image_url`. Tool-call messages can include `tool_calls` or `tool_call_id`. Optional parameters are not universal provider features. ```bash theme={null} curl https://api.voidai.app/v1/chat/completions \ -H "Authorization: Bearer $VOIDAI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}' ``` ## Response Non-streaming responses use the OpenAI chat-completion shape: `id`, `object`, `model`, `choices`, and `usage`. Read text from `choices[0].message.content`; a tool response can instead provide `tool_calls`. Streaming responses use SSE chunks with `choices[].delta`; consumers must handle empty choices in usage chunks. See [SDK examples](/guides/openai-sdk), [billing](/guides/credits), and [error handling](/guides/errors). Claude-family routing limitations are documented on the [Messages page](/api-reference/messages/create). # Get Account Credits Source: https://docs.voidai.app/api-reference/credits/get Read the authenticated VoidAI account credit balance, recorded spend, vault balance, and reset metadata limitations. `GET https://api.voidai.app/v1/credits` Requires [authentication](/authentication). Returns account-specific credit information. ```bash theme={null} curl https://api.voidai.app/v1/credits \ -H "Authorization: Bearer $VOIDAI_API_KEY" ``` | Field | Meaning | | - | - | | `current_credits` | Current regular credit balance. | | `daily_limit` | Reported account credit limit. | | `credits_used` | Aggregated request spend; not simply the limit minus the balance. | | `vault_credits` | Separate persistent credit balance. | | `plan` | Account plan. | | `last_reset`, `reset_time`, `reset_cycle_days` | Reported reset metadata. See the limitation below. | Reset metadata is currently approximate and does not reliably describe every account's actual reset cycle. Do not build a countdown or entitlement decision from these fields. Use the [dashboard](https://voidai.app/dashboard) for account information and [request usage](/api-reference/usage/get) for individual request charges. Treat this response as private account data. # Get Discount-Eligible Models Source: https://docs.voidai.app/api-reference/discounts/eligible-models List models eligible for VoidAI account discounts without assuming inference access or an active discount. `GET https://api.voidai.app/v1/discounts/eligible-models` Requires [authentication](/authentication). Returns discount eligibility for the account's plan. ```bash theme={null} curl https://api.voidai.app/v1/discounts/eligible-models \ -H "Authorization: Bearer $VOIDAI_API_KEY" ``` The response contains `eligible_models`, `count`, and an `info` object describing the discount program. This is discount eligibility, not a list of all callable models, and does not imply that a discount is active. Use [My Discounts](/api-reference/discounts/my-discounts) for the account's current rates and expiry. See [model eligibility](/api-reference/models/list#catalog-presence-and-account-eligibility) for the separate access checks. # Get My Discounts Source: https://docs.voidai.app/api-reference/discounts/my-discounts Read active VoidAI model discounts, discounted input and output rates, expiry, and remaining time for your account. `GET https://api.voidai.app/v1/discounts/my-discounts` Requires [authentication](/authentication). Returns personalized discount information for the authenticated account. ```bash theme={null} curl https://api.voidai.app/v1/discounts/my-discounts \ -H "Authorization: Bearer $VOIDAI_API_KEY" ``` The response contains `active_discounts`, `has_discount`, `eligible_models`, `next_rotation`, and `info`. Each active discount includes: * `model_id`, `model_name`, and `model_owner`. * `discount.multiplier` and descriptive savings information. * `pricing.input_multiplier` and `pricing.output_multiplier`, each with original and discounted rates. * Input/output cost-per-1,000-token information. * `expires_at` and `time_remaining`. Use the returned expiry and rates rather than hardcoding a discount. An applicable multiplier greater than 1 divides the calculated cost: a 2× discount halves it before rounding. See [credit calculations](/guides/credits) for cache, fixed-cost, and operation-specific billing rules. Discount eligibility does not independently grant model access. Treat the response as private account data. # Create Embeddings Source: https://docs.voidai.app/api-reference/embeddings/create Create text embeddings with VoidAI using a string or array of strings and a supported embedding model. `POST https://api.voidai.app/v1/embeddings` Requires [authentication](/authentication) and a model that advertises `/v1/embeddings`. | Field | Type | Description | | - | - | - | | `model` | string, required | Exact embedding model ID, such as `text-embedding-3-small`. | | `input` | string or array of strings, required | Text to embed. Token-ID arrays are not accepted by this gateway schema. | | `encoding_format` | string | `float` or `base64`, subject to provider support. | | `dimensions` | number | Requested dimensions where supported by the model. | ```bash theme={null} curl https://api.voidai.app/v1/embeddings \ -H "Authorization: Bearer $VOIDAI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"model":"text-embedding-3-small","input":"Text to embed"}' ``` The response contains a `data` array with each embedding and its input `index`, plus `model` and token `usage`. Check [current model pricing](https://voidai.app/models); do not assume a universal fixed embedding cost. # Edit Images with VoidAI Source: https://docs.voidai.app/api-reference/images/edits Edit images with multipart uploads, image arrays, masks, current GPT Image restrictions, and model-dependent limits. `POST https://api.voidai.app/v1/images/edits` Send `multipart/form-data` with [authentication](/authentication). Image routes are unavailable to free-plan accounts. Select a model that advertises `/v1/images/edits`; the default is `gpt-image-2`. ## Request fields | Field | Type | Description | | - | - | - | | `image` or `image[]` | file(s), required | One file named `image`, or repeated `image[]` fields; 1–16 input files. | | `prompt` | string, required | Non-whitespace edit instructions; current GPT image models allow at most 32,000 characters. | | `model` | string | Defaults to `gpt-image-2`. | | `mask` | file | Optional mask where supported by the model/provider. | | `n` | integer | 1–10 output images. | | `size`, `quality`, `output_format`, `output_compression` | string / integer | Same gateway values and model constraints as [image generation](/api-reference/images/generations). | | `background`, `moderation`, `seed`, `stream`, `partial_images`, `user` | varies | Same constraints as image generation. | | `input_fidelity` | string | `high` or `low`; rejected by `gpt-image-2`. | The editing form does not accept generation-only `thinking`, `style`, or `response_format` options. `gpt-image-2` does not support transparent backgrounds. File format and upload-size constraints depend on the selected provider; the gateway does not define a universal PNG-only or 4 MB limit. ```bash theme={null} curl https://api.voidai.app/v1/images/edits \ -H "Authorization: Bearer $VOIDAI_API_KEY" \ -F model=gpt-image-2 \ -F image=@source.png \ -F 'prompt=Make the sky a warm sunset' \ -F n=1 \ -F size=1024x1024 \ -F output_format=png ``` For multiple references, repeat `-F 'image[]=@reference.png'` using each filename. Let your HTTP client set the multipart boundary rather than setting a plain Content-Type header manually. Responses and per-image billing follow [image generation](/api-reference/images/generations#response-and-billing). Use non-streaming unless your selected model/provider's streaming support is confirmed. # Generate Images with VoidAI Source: https://docs.voidai.app/api-reference/images/generations Generate images using supported VoidAI models, with current image count, size, quality, format, and GPT Image constraints. `POST https://api.voidai.app/v1/images/generations` Send JSON with [authentication](/authentication). Image routes are unavailable to free-plan accounts. Choose a model advertising this endpoint, such as `gpt-image-2`; models that only advertise chat/Responses use those routes instead. ## Request fields | Field | Type | Description | | - | - | - | | `model` | string, required | Exact image model ID. | | `prompt` | string, required | Non-empty text; current GPT image models allow at most 32,000 characters. | | `n` | integer | 1–10 images. | | `size` | string | A supported named size, `auto`, or validated `WxH`. See below. | | `quality` | string | `low`, `medium`, `high`, `auto`, `standard`, or `hd`; model support varies. | | `output_format` | string | `png`, `jpeg`, or `webp`. | | `output_compression` | integer | 0–100, only with JPEG or WebP. | | `background` | string | `transparent`, `opaque`, or `auto`; `gpt-image-2` rejects `transparent`. | | `moderation` | string | `low` or `auto`. | | `seed` | integer | Provider-dependent seed. | | `thinking` | string | `off`, `low`, `medium`, or `high`; accepted only for `gpt-image-2`. | | `stream`, `partial_images` | boolean / integer | Streaming options; partial images is 0–3 and requires `stream: true`. | | `style`, `response_format` | string | Non-GPT-image models only: style `vivid`/`natural`; response format `url`/`b64_json`. | | `user` | string | Optional caller-supplied end-user identifier. | The schema accepts streaming options, but current GPT image catalog flags do not advertise streaming. Treat streaming as model/provider-dependent and use non-streaming unless support is confirmed. ## Sizes and model constraints Named sizes accepted by the gateway are `256x256`, `512x512`, `1024x1024`, `1536x1024`, `1024x1536`, `2048x2048`, `2048x1152`, `3840x2160`, `2160x3840`, `4096x4096`, and `auto`. Custom dimensions must be multiples of 16, have no edge above 3840, have an aspect ratio at most 3:1, and contain between 655,360 and 8,294,400 pixels. These custom-size checks do not apply to the named sizes above. Selected providers can impose additional limits. All `gpt-image*` models reject `style` and `response_format`. Use `output_format` to choose the encoding; read `b64_json` or `url` from the result rather than assuming a URL. ```bash theme={null} curl https://api.voidai.app/v1/images/generations \ -H "Authorization: Bearer $VOIDAI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"model":"gpt-image-2","prompt":"A watercolor mountain landscape","n":1,"size":"1024x1024","output_format":"png"}' ``` ## Response and billing Non-streaming responses contain `created` and a `data` array with `url` and/or `b64_json`, and optionally `revised_prompt`. Images are billed per output image; see [billing](/guides/credits) and [current prices](https://voidai.app/models). # Count Message Input Tokens Source: https://docs.voidai.app/api-reference/messages/count-tokens Count input tokens for an Anthropic-format VoidAI request, including estimation behavior and access requirements. `POST https://api.voidai.app/v1/messages/count_tokens` Requires [authentication](/authentication). Send `model` and `messages`; optional context includes `system`, `tools`, `tool_choice`, and `thinking`. A `max_tokens` output limit is not required for this operation. A successful count does not establish that your account can run inference with the model. ```bash theme={null} curl https://api.voidai.app/v1/messages/count_tokens \ -H "x-api-key: $VOIDAI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"model":"claude-sonnet-4-6","messages":[{"role":"user","content":"Hello"}]}' ``` The response contains `input_tokens`, a number. This endpoint is not billed. A native provider count is used when available; availability failures can fall back to a local estimate. Invalid provider request shapes can still return an error. Treat the result as an estimate when planning a later generation, not a guarantee of its final charge. See [Messages](/api-reference/messages/create) for access and usage checks, and [billing](/guides/credits) for cache accounting. # Create an Anthropic-Compatible Message Source: https://docs.voidai.app/api-reference/messages/create Use the VoidAI Messages endpoint with model-specific access, streaming, token limits, and Claude usage disclosures. `POST https://api.voidai.app/v1/messages` Requires [authentication](/authentication), account eligibility, and a model that supports this endpoint. The API accepts Anthropic-style messages. Optional `anthropic-version` and `anthropic-beta` headers are forwarded to the selected provider. | Field | Type | Description | | - | - | - | | `model` | string, required | Exact model ID. | | `messages` | array, required | Anthropic-format conversation messages and content blocks. | | `max_tokens` | number, required | Output limit of at least 1 token. | | `system` | string or content blocks | Optional system instructions. | | `stream` | boolean | Request server-sent events. | | `temperature`, `top_p`, `top_k`, `stop_sequences` | varies | Sampling controls where supported. | | `tools`, `tool_choice`, `thinking`, `metadata` | varies | Anthropic-format options where supported by the model/provider. | ```bash theme={null} curl https://api.voidai.app/v1/messages \ -H "x-api-key: $VOIDAI_API_KEY" \ -H 'Content-Type: application/json' \ -H 'anthropic-version: 2023-06-01' \ -d '{"model":"claude-sonnet-4-6","max_tokens":256,"messages":[{"role":"user","content":"Hello"}]}' ``` Non-streaming output uses the Messages shape, including `id`, `content`, `stop_reason`, and `usage`. Streaming emits Anthropic-style events. Provider-specific extensions and beta features are not guaranteed across every route. ## Claude access and usage checks Claude models require an explicit account access grant in addition to plan eligibility. Requests are subject to usage checks, including restrictions on certain roleplay content. Flagged requests may result in staff review of account/request metadata and a prompt excerpt of up to 400 characters. Some requests may be rejected by these checks. This applies to Claude-family requests through chat and Responses formats as well. Contact [support](https://discord.gg/pQab7kukfu) for account eligibility or permitted-use questions. Use [Count Tokens](/api-reference/messages/count-tokens) for an input count and [credits and caching](/guides/credits) to interpret usage. # Get Model Details Source: https://docs.voidai.app/api-reference/models/get Look up a VoidAI model by exact ID and inspect endpoint support, pricing, and capability metadata. `GET https://api.voidai.app/v1/models/{id}` This endpoint is public. Replace `{id}` with a URL-encoded model ID from [List Models](/api-reference/models/list). ```bash theme={null} curl https://api.voidai.app/v1/models/gpt-4o-mini ``` The response is a single model object, without the list wrapper. An unknown model returns HTTP 404. ## Response fields | Field | Meaning | | - | - | | `id`, `object`, `owned_by` | Exact identifier, `model` object type, and catalog owner label. | | `endpoints` | Advertised endpoint paths. | | `plan_requirements` | Catalog plan metadata; not a complete account authorization decision. | | `cost_type`, `base_cost` | `per_token` or `fixed`, and the model's base credit cost. | | `input_multiplier`, `output_multiplier` | Input and output credit rates. | | `cache_read_multiplier`, `cache_write_multiplier` | Relative input-cache rates; cache-write rate is optional. | | `long_context_threshold`, `long_context_input_multiplier`, `long_context_output_multiplier` | Optional long-context pricing fields. | | `max_context_tokens`, `max_output_tokens` | Optional token limits. | | `supports_streaming`, `supports_tool_calling` | Advertised capabilities; endpoint/provider constraints still apply. | There is no `created` timestamp in the current model response. Additional fields can be introduced; ignore fields your integration does not need. Catalog presence does not establish account access. Review [eligibility](/api-reference/models/list#catalog-presence-and-account-eligibility) and [current prices](https://voidai.app/models) before sending inference requests. # List VoidAI Models Source: https://docs.voidai.app/api-reference/models/list Read the public VoidAI model catalog, supported endpoints, capability flags, pricing fields, and account eligibility limitations. `GET https://api.voidai.app/v1/models` This endpoint is public and does not require an API key. It returns `{ "object": "list", "data": [...] }`, with the current catalog's model objects. ```bash theme={null} curl https://api.voidai.app/v1/models ``` ## Model fields | Field | Meaning | | - | - | | `id`, `object`, `owned_by` | Exact identifier, `model` object type, and catalog owner label. | | `endpoints` | Advertised endpoint paths. | | `plan_requirements` | Catalog plan metadata; not a complete account authorization decision. | | `cost_type`, `base_cost` | `per_token` or `fixed`, and the model's base credit cost. | | `input_multiplier`, `output_multiplier` | Input and output credit rates. | | `cache_read_multiplier`, `cache_write_multiplier` | Relative input-cache rates; cache-write rate is optional. | | `long_context_threshold`, `long_context_input_multiplier`, `long_context_output_multiplier` | Optional long-context pricing fields. | | `max_context_tokens`, `max_output_tokens` | Optional token limits. | | `supports_streaming`, `supports_tool_calling` | Advertised capabilities; endpoint/provider constraints still apply. | There is no `created` timestamp in the current model response. Additional fields can be introduced; ignore fields your integration does not need. ## Catalog presence and account eligibility This is a catalog, not a list filtered to your account. Plan rules, explicit account grants, endpoint policy, and available credits determine whether a request succeeds. Claude models require an additional access grant; image endpoints reject free-plan requests. Moderation metadata can appear even though the public moderation operation is disabled. Choose the exact `id` and confirm that `endpoints` contains your target route. Some image-capable Gemini models advertise chat/Responses routes rather than `/v1/images/generations`; follow their advertised route. Capability flags and provider support can differ, so handle unsupported-feature errors. See the [searchable model catalog and prices](https://voidai.app/models), [single-model lookup](/api-reference/models/get), and [credit calculations](/guides/credits). This metadata does not guarantee provider availability. # Moderation Endpoint Availability Source: https://docs.voidai.app/api-reference/moderations/create Current availability of the VoidAI moderation endpoint for public API integrations. The moderation endpoint is currently unavailable to normal API accounts. A valid authenticated request receives HTTP 404 with error code `endpoint_disabled`. The model catalog can include moderation metadata, but catalog presence does not make this endpoint available to your account. Do not build a public integration that depends on `POST /v1/moderations`. This page remains available for existing links. Browse [supported API formats](/index) or contact [support](https://discord.gg/pQab7kukfu) for availability questions. # Compact Response Context Source: https://docs.voidai.app/api-reference/responses/compact Compact conversation context through the VoidAI Responses API, with native or summarization fallback behavior and billing. `POST https://api.voidai.app/v1/responses/compact` Requires [authentication](/authentication) and access to the selected model. This operation is non-streaming and billed. Send `model` and the context to compact. The schema accepts `input` as text, input items, or null, and supports optional `instructions`, `previous_response_id`, `tools`, and `reasoning`. Availability of context continuation and other options depends on the model/provider. ```bash theme={null} curl https://api.voidai.app/v1/responses/compact \ -H "Authorization: Bearer $VOIDAI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"model":"gpt-4o-mini","input":"The user is planning a three-day trip and prefers museums and vegetarian food.","instructions":"Preserve the important preferences."}' ``` The gateway uses native compaction where supported. Otherwise it can make a normal generation request to summarize the supplied context. The output and semantics can therefore differ by provider; do not assume an opaque compaction item or identical context reconstruction on every model. Inspect the returned output before using it in subsequent requests. See [Responses](/api-reference/responses/create), [credits](/guides/credits), and [request usage](/api-reference/usage/get). # Create a Response Source: https://docs.voidai.app/api-reference/responses/create Use the VoidAI Responses API for supported model input, tools, conversation context, and named streaming events. `POST https://api.voidai.app/v1/responses` Requires [authentication](/authentication) and a model that advertises `/v1/responses`. The gateway accepts the OpenAI Responses request format; supported features depend on the selected model/provider. | Field | Type | Description | | - | - | - | | `model` | string, required | Exact model ID. | | `input` | string or array | Text or Responses-format input items. | | `instructions` | string | Optional instructions. | | `stream` | boolean | Request named server-sent events. | | `max_output_tokens` | number | Optional output limit. | | `previous_response_id` | string | Provider-dependent continuation context. | | `tools`, `tool_choice`, `reasoning`, `text` | varies | Model/provider-dependent tools, reasoning, and output-format options. | ```bash theme={null} curl https://api.voidai.app/v1/responses \ -H "Authorization: Bearer $VOIDAI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"model":"gpt-4o-mini","input":"Explain what an API is in one sentence."}' ``` Non-streaming responses contain a response `id`, `output` items, and usage information when available. Streaming uses named events rather than Chat Completions delta chunks. Handle the Responses event format with a compatible client. A provider may reject an unsupported feature even when the model supports this endpoint. Claude-family requests are also subject to [Claude access and usage checks](/api-reference/messages/create#claude-access-and-usage-checks). See [compaction](/api-reference/responses/compact) and [request usage](/api-reference/usage/get). # Get Request Usage Source: https://docs.voidai.app/api-reference/usage/get Look up a VoidAI request by completion ID or request UUID and inspect recorded tokens, credits, status, and latency. `GET https://api.voidai.app/v1/usage/{id}` Requires [authentication](/authentication). Supply a completion/response ID or the internal request UUID. The authenticated account must own the request; an ID is not an access credential. ```bash theme={null} curl "https://api.voidai.app/v1/usage/$VOIDAI_RESPONSE_ID" \ -H "Authorization: Bearer $VOIDAI_API_KEY" ``` | Field | Meaning | | - | - | | `id` | Completion ID, or request ID when no completion ID is recorded. | | `status`, `model` | Recorded request status and model. | | `usage.total_tokens`, `usage.input_tokens`, `usage.output_tokens` | Recorded token counts. | | `credits_used` | Recorded charge in credits. | | `latency_ms` | Recorded latency in milliseconds. | | `created_at`, `completed_at` | Unix timestamps in milliseconds; completion can be null. | Additional routing metadata may be returned; integrations should not depend on it. An unfinished request may not yet have final usage. See [billing](/guides/credits) for how cache and model rates affect charges, and [credits](/api-reference/credits/get) for the account balance. # Create Video: Current Availability Source: https://docs.voidai.app/api-reference/video/create Current availability of VoidAI video create requests and supported alternatives. Video endpoints are not currently available in the deployed VoidAI API. Do not rely on the previously documented `/v1/videos` workflow. No video create, list, status, download, or delete route is currently registered. Earlier Sora examples on this page do not describe a supported integration. This URL is retained for existing bookmarks and links. Check the [live model catalog](/api-reference/models/list) and [API documentation](/index) for supported operations, or contact [support](https://discord.gg/pQab7kukfu) about video availability. # Delete Video: Current Availability Source: https://docs.voidai.app/api-reference/video/delete Current availability of VoidAI video delete requests and supported alternatives. Video endpoints are not currently available in the deployed VoidAI API. Do not rely on the previously documented `/v1/videos` workflow. No video create, list, status, download, or delete route is currently registered. Earlier Sora examples on this page do not describe a supported integration. This URL is retained for existing bookmarks and links. Check the [live model catalog](/api-reference/models/list) and [API documentation](/index) for supported operations, or contact [support](https://discord.gg/pQab7kukfu) about video availability. # Download Video: Current Availability Source: https://docs.voidai.app/api-reference/video/download Current availability of VoidAI video download requests and supported alternatives. Video endpoints are not currently available in the deployed VoidAI API. Do not rely on the previously documented `/v1/videos` workflow. No video create, list, status, download, or delete route is currently registered. Earlier Sora examples on this page do not describe a supported integration. This URL is retained for existing bookmarks and links. Check the [live model catalog](/api-reference/models/list) and [API documentation](/index) for supported operations, or contact [support](https://discord.gg/pQab7kukfu) about video availability. # Get Video: Current Availability Source: https://docs.voidai.app/api-reference/video/get Current availability of VoidAI video get requests and supported alternatives. Video endpoints are not currently available in the deployed VoidAI API. Do not rely on the previously documented `/v1/videos` workflow. No video create, list, status, download, or delete route is currently registered. Earlier Sora examples on this page do not describe a supported integration. This URL is retained for existing bookmarks and links. Check the [live model catalog](/api-reference/models/list) and [API documentation](/index) for supported operations, or contact [support](https://discord.gg/pQab7kukfu) about video availability. # List Video: Current Availability Source: https://docs.voidai.app/api-reference/video/list Current availability of VoidAI video list requests and supported alternatives. Video endpoints are not currently available in the deployed VoidAI API. Do not rely on the previously documented `/v1/videos` workflow. No video create, list, status, download, or delete route is currently registered. Earlier Sora examples on this page do not describe a supported integration. This URL is retained for existing bookmarks and links. Check the [live model catalog](/api-reference/models/list) and [API documentation](/index) for supported operations, or contact [support](https://discord.gg/pQab7kukfu) about video availability. # VoidAI API Authentication Source: https://docs.voidai.app/authentication Authenticate VoidAI requests with a Bearer API key or x-api-key header, understand public model endpoints, and protect server-side credentials. Most VoidAI API endpoints require a key or supported OAuth access token. The public model catalog at `GET /v1/models` and `GET /v1/models/{id}` does not require authentication. ## Bearer authentication Create a key in the [dashboard](https://voidai.app/dashboard). VoidAI API keys begin with `sk-voidai-`. Store yours in `VOIDAI_API_KEY` on your server. ```bash theme={null} curl https://api.voidai.app/v1/credits \ -H "Authorization: Bearer $VOIDAI_API_KEY" ``` Authorized OAuth integrations can use their VoidAI OAuth access token with the same Bearer header. An OAuth token is not an API key; use the credential issued for your integration. ## Anthropic-style header The gateway also accepts `x-api-key` when no `Authorization` header is supplied: ```bash theme={null} curl https://api.voidai.app/v1/messages/count_tokens \ -H "x-api-key: $VOIDAI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"model":"claude-sonnet-4-6","messages":[{"role":"user","content":"Hello"}]}' ``` If both headers are present, `Authorization` takes precedence. An invalid Authorization header is not rescued by a valid `x-api-key` header. ## Access checks A valid credential does not grant access to every model. Account status, configured IP restrictions, balance, plan eligibility, and model-specific grants can affect a request. Claude models require additional account access; see the [Claude usage disclosure](/api-reference/messages/create#claude-access-and-usage-checks). Keep credentials out of client-side code, source control, and logs. Manage or replace keys through your dashboard, and use separate credentials for separate integrations. See [error handling](/guides/errors) when a request is rejected. # VoidAI Credits, Pricing, and Cache Billing Source: https://docs.voidai.app/guides/credits Understand VoidAI input and output rates, cache reads and writes, image billing, discounts, and account credit usage. VoidAI charges credits according to the model and operation. Browse [current models and prices](https://voidai.app/models), or inspect the [model API](/api-reference/models/list). Model rates and eligibility can change; the examples below explain the calculation rather than quote current prices. ## Token-based pricing Input and output can have different rates. Cache reads and cache writes are separate portions of the total input: ```text theme={null} uncached input = total input - cache-read input - cache-write input raw cost = base_cost + uncached input × input_multiplier + cache-read input × input_multiplier × cache_read_multiplier + cache-write input × input_multiplier × cache_write_multiplier + output tokens × output_multiplier credits = round(raw cost / applicable discount multiplier) ``` If the model has no cache-write multiplier, the calculation uses 1. If no discount greater than 1 applies, the cost is not divided. Do not add cache tokens to the total input a second time. For an **illustrative** model with input rate 1, output rate 3, cache-read multiplier 0.1, cache-write multiplier 1.25, and base cost 0: | Input or output | Tokens | Credits | | - | -: | -: | | Uncached input | 600 | 600 | | Cache-read input | 300 | 30 | | Cache-write input | 100 | 125 | | Output | 200 | 600 | | Total before a discount | | 1,355 | With an applicable 2× discount, this example rounds to 678 credits. ## Context and service tiers Where a model exposes long-context rates, those rates apply when pricing input is strictly greater than `long_context_threshold`. A supported priority service tier can also increase rates. The catalog does not expose every service-tier adjustment. Usage fields differ between API formats. In native Messages responses, `input_tokens` can exclude the separate `cache_read_input_tokens` and `cache_creation_input_tokens`. Billing can use a local input estimate when it exceeds reported input usage, so raw upstream counters alone may not reproduce the final charge. Use [request usage](/api-reference/usage/get) to inspect `credits_used`. ## Fixed-cost operations and images Models with `cost_type: "fixed"` use a base cost rather than the token formula, subject to the operation's billing rules. Image generation/editing is charged per image: non-streaming requests use the number of returned images; completed streaming requests use the requested count. Do not assume one request always costs one image's price. See each [image endpoint](/api-reference/images/generations) for access requirements. A model's appearance in the public catalog is not a guarantee of eligibility. ## Balance and discounts * View your balance and plan in the [dashboard](https://voidai.app/dashboard), or call [GET /v1/credits](/api-reference/credits/get). * Read active model-specific discounts with [My Discounts](/api-reference/discounts/my-discounts). * Use [request usage](/api-reference/usage/get) for the recorded spend on a completed request. Rate limits and account entitlements vary. Handle HTTP 429 using the response's retry guidance rather than assuming a universal requests-per-minute allowance. # Handle VoidAI API Errors Source: https://docs.voidai.app/guides/errors Diagnose authentication, eligibility, validation, rate-limit, and provider errors from VoidAI API responses. Check the HTTP status and response body before reading a success payload. Gateway and upstream errors can use different fields; do not assume every failure includes an identical error envelope or a reference ID. | Status | What to check | | - | - | | 400 | Request shape, required parameters, model-specific constraints, and policy restrictions. | | 401 | Missing, expired, or invalid credentials; see [authentication](/authentication). | | 403 | Account, IP, plan, or model access restrictions. | | 404 | Unknown resource/model or an unavailable endpoint. | | 429 | Rate or usage limits; inspect any retry guidance. | | 5xx | Gateway/provider errors or temporary availability problems. | A public model listing does not prove that your account can call it. Claude access requires an additional grant. The [moderation endpoint](/api-reference/moderations/create) is unavailable to normal accounts, and [video routes](/api-reference/video/create) are not currently registered. ## Handle SDK exceptions ```python theme={null} import os from openai import OpenAI, APIError, AuthenticationError, RateLimitError client = OpenAI( api_key=os.environ['VOIDAI_API_KEY'], base_url='https://api.voidai.app/v1', ) try: response = client.chat.completions.create( model='gpt-4o-mini', messages=[{'role': 'user', 'content': 'Hello'}], ) except AuthenticationError: print('Check the credential and authentication header.') except RateLimitError: print('Inspect retry guidance and account limits before retrying.') except APIError as error: print('Request failed with status:', error.status_code) ``` For transient failures, use bounded retries with exponential backoff and jitter. Avoid blindly retrying validation, authentication, or access failures. A failed connection does not always establish whether an inference request completed, so repeated requests can create additional usage. ## Get support Save the status, endpoint, time, and any `reference_id` or request/response ID returned. Remove API keys and sensitive prompt content before sharing diagnostics through [support](https://discord.gg/pQab7kukfu). Check account state in your [dashboard](https://voidai.app/dashboard). # Use the OpenAI SDK with VoidAI Source: https://docs.voidai.app/guides/openai-sdk Configure OpenAI Python and JavaScript clients for VoidAI chat completions and streaming, with model-specific compatibility guidance. The OpenAI SDK can call VoidAI's supported OpenAI-compatible endpoints. Set the API base URL to `https://api.voidai.app/v1` and use your VoidAI key. Support for tools, streaming, input modalities, and optional parameters varies by model and endpoint. ## Configure a client ```python Python theme={null} # pip install openai import os from openai import OpenAI client = OpenAI( api_key=os.environ['VOIDAI_API_KEY'], base_url='https://api.voidai.app/v1', ) ``` ```javascript JavaScript theme={null} // npm install openai import OpenAI from 'openai'; const client = new OpenAI({ apiKey: process.env.VOIDAI_API_KEY, baseURL: 'https://api.voidai.app/v1', }); ``` ## Chat completions ```python theme={null} response = client.chat.completions.create( model='gpt-4o-mini', messages=[{'role': 'user', 'content': 'Write a short welcome message.'}], ) print(response.choices[0].message.content) ``` Choose an exact model ID from the [catalog](/api-reference/models/list) and check your eligibility. A model that supports chat is not necessarily available on every other endpoint. ## Streaming ```python theme={null} stream = client.chat.completions.create( model='gpt-4o-mini', messages=[{'role': 'user', 'content': 'Write a short welcome message.'}], stream=True, stream_options={'include_usage': True}, ) for chunk in stream: if chunk.choices: print(chunk.choices[0].delta.content or '', end='') ``` Usage-only chunks can have an empty `choices` array. Save the response ID if you need to query [request usage](/api-reference/usage/get). ## Other supported operations Use the endpoint reference for its request format, constraints, and supported models: * [Responses](/api-reference/responses/create) and [response compaction](/api-reference/responses/compact) * [Image generation](/api-reference/images/generations) and [image editing](/api-reference/images/edits) * [Text-to-speech](/api-reference/audio/speech), [transcription](/api-reference/audio/transcriptions), and [translation](/api-reference/audio/translations) * [Embeddings](/api-reference/embeddings/create) For Anthropic-format integrations, use the [Messages endpoint](/api-reference/messages/create). Read its Claude routing disclosure before choosing an integration. # Use OpenCode with VoidAI Source: https://docs.voidai.app/guides/opencode Configure OpenCode V2 with a custom VoidAI Chat Completions provider, environment-variable credentials, eligible models, and tool-calling requirements. Configure OpenCode's custom OpenAI-compatible provider to send [Chat Completions](/api-reference/chat/completions) requests to VoidAI. This configuration follows the official OpenCode V2 documentation, checked on October 1, 2026, when `@opencode/cli` was version `2.0.21`. An end-to-end OpenCode integration with VoidAI has not been run. Model and provider behavior can vary. ## Before you configure OpenCode Use an existing OpenCode installation and a VoidAI API key available to its process as `VOIDAI_API_KEY`. See [authentication](/authentication) if you need a key. Choose an exact model `id` from the [VoidAI catalog](/api-reference/models/list). For this guide, the model must advertise `/v1/chat/completions` in `endpoints`, with `supports_streaming` and `supports_tool_calling` enabled. Your account must also satisfy its plan and access requirements and have sufficient credits. Catalog visibility alone does not establish eligibility or guarantee provider availability. If you choose a Claude model, an additional account access grant is required. Read the [Claude access and usage checks](/api-reference/messages/create#claude-access-and-usage-checks), which also apply when Claude is called through Chat Completions. ## Configure OpenCode V2 Create or merge this configuration into your project's `opencode.json`. Replace `REPLACE_WITH_EXACT_MODEL_ID` with the selected VoidAI model ID before starting a session. ```json theme={null} { "model": "voidai/coding", "providers": { "voidai": { "name": "VoidAI", "package": "@opencode/ai/providers/openai-compatible", "settings": { "baseURL": "https://api.voidai.app/v1", "apiKey": "{env:VOIDAI_API_KEY}" }, "models": { "coding": { "modelID": "REPLACE_WITH_EXACT_MODEL_ID", "name": "VoidAI coding model", "capabilities": { "tools": true, "input": ["text"], "output": ["text"] } } } } } } ``` `voidai/coding` is OpenCode's local model selection: `voidai` is the provider ID and `coding` is the configured alias. `modelID` is the exact identifier sent to VoidAI. The base URL includes `/v1`; do not append `/chat/completions` to it. The `{env:VOIDAI_API_KEY}` expression reads the credential from the environment. Make it available to the OpenCode process or server that sends requests, and keep the actual key out of the configuration file. In the model picker, select `voidai/coding`; `/models` shows the models you configured. The `tools` capability tells OpenCode to use tools. It does not add tool support to a model. This example declares text input and output; enable other modalities only when supported by your chosen route and model. OpenCode's official [V2 provider configuration](https://opencode.ai/v2/docs/providers) and [model configuration](https://opencode.ai/v2/docs/models) describe these fields. ## Set model limits deliberately When the selected catalog entry supplies `max_context_tokens` and `max_output_tokens`, use those values for `providers.voidai.models.coding.limit.context` and `limit.output`. These are numeric token limits, not prices. Check any additional provider constraints before choosing a larger request budget. The example leaves limits unset because they vary by model. OpenCode uses fallback limits for an unknown custom model; those defaults are not a measurement of VoidAI's limits. If the catalog omits a limit, confirm it before relying on OpenCode's remaining-context display. See the official [custom-model defaults](https://opencode.ai/v2/docs/models#aliases). ## Chat, Responses, and tools This setup chooses the OpenAI-compatible Chat runtime. OpenCode documents a separate `@opencode/ai/providers/openai-compatible/responses` runtime for Responses. VoidAI exposing [Responses](/api-reference/responses/create) does not establish that every OpenCode Responses feature works with every model. Keep this guide's package and Chat endpoint together. OpenCode sends tool definitions and handles tool execution in its own environment. VoidAI returns model output and tool-call requests. Tool schemas, streamed arguments, follow-up tool results, and optional reasoning behavior still depend on the selected model and provider. See the separate [tool-calling walkthrough](/guides/tool-calling) for the request/result cycle. ## OpenCode V1.18.x Use this separate configuration if you are running OpenCode V1.18.x, including `opencode-ai` version `1.18.34`. V1 uses `provider`, `npm`, `options`, and model `id`. Apply the same prerequisites and model-limit checks above. ```json theme={null} { "$schema": "https://opencode.ai/config.json", "model": "voidai/coding", "provider": { "voidai": { "npm": "@ai-sdk/openai-compatible", "name": "VoidAI", "options": { "baseURL": "https://api.voidai.app/v1", "apiKey": "{env:VOIDAI_API_KEY}" }, "models": { "coding": { "id": "REPLACE_WITH_EXACT_MODEL_ID", "name": "VoidAI coding model", "tool_call": true, "modalities": { "input": ["text"], "output": ["text"] } } } } } } ``` In V1, optional limits go under `provider.voidai.models.coding.limit`. Use `@ai-sdk/openai-compatible` for Chat Completions; OpenCode's [V1 provider guide](https://opencode.ai/docs/providers/#custom-provider) distinguishes it from the Responses package. Do not combine V1 and V2 fields inside a provider or model entry. OpenCode's [migration guide](https://opencode.ai/v2/docs/migrate-v1/) explains its support for existing V1 configurations and the native V2 format. ## Troubleshooting * **Provider or model missing:** check your OpenCode version, configuration location, and the `voidai/coding` selection. A custom provider needs an explicit model entry. * **401:** confirm `VOIDAI_API_KEY` reaches the process sending requests and review [authentication](/authentication). * **403 or access denied:** check account eligibility, credits, and any Claude access grant. Adding a model to OpenCode does not grant API access. * **404 or unknown model:** check the exact upstream model ID, `/v1` base URL, and the model's advertised [endpoints](/api-reference/models/list). * **Tool, streaming, or validation error:** check the selected model's capability flags and provider constraints. Declaring a capability in OpenCode cannot make an unsupported request succeed. For rate limits and provider failures, follow [API error handling](/guides/errors). OpenCode's token or cost display is not authoritative for VoidAI billing; use [credits and caching](/guides/credits) and your account usage. # Tool Calling with the VoidAI API Source: https://docs.voidai.app/guides/tool-calling Build a bounded Chat Completions tool loop with VoidAI: validate arguments, handle multiple tool calls, and return each result with its tool_call_id. Tool calling lets a model request data or an action from your application. Your application decides which functions may run, executes them, and sends the results back to the model. This guide uses [Chat Completions](/api-reference/chat/completions) and a small, fictional project's formatting conventions. The example reads an in-memory dictionary; it does not run shell commands, evaluate generated code, or modify files. ## Before you start * Configure the [OpenAI Python SDK for VoidAI](/guides/openai-sdk) and store your key in `VOIDAI_API_KEY`. * Choose an exact ID from [models and pricing](https://voidai.app/models) that advertises `/v1/chat/completions` and `supports_tool_calling: true`. * Confirm your account can use that model. Catalog metadata does not guarantee account access or current availability. Claude-family models also have [additional access and usage checks](/api-reference/messages/create#claude-access-and-usage-checks). The example defaults to `gpt-4o-mini`, which advertises chat and tool support in the catalog checked on October 1, 2026. Set `VOIDAI_MODEL` to use a different eligible model. Model behavior and optional parameters can differ. ## How the exchange works 1. Send the conversation and a function definition in `tools`. 2. Read the assistant's `tool_calls`. Validate each function name and its JSON arguments in your application. 3. Append the assistant message, then one `role: "tool"` message for **every** call, using that call's `id` as `tool_call_id`. 4. Send the updated conversation again. Stop when the model returns an answer or your loop limit is reached. A tool definition describes a function; it does not execute it. The function's return value becomes the tool message's string `content`. ## A complete Python example Install the `openai` package if it is not already part of your application. The key is read from the environment and is never included in the tool definition. ```python theme={null} import json import os from openai import OpenAI client = OpenAI( api_key=os.environ["VOIDAI_API_KEY"], base_url="https://api.voidai.app/v1", timeout=30.0, max_retries=0, ) model = os.environ.get("VOIDAI_MODEL", "gpt-4o-mini") # Example data for a fictional project, not universal style rules. CONVENTIONS = { "python": {"indent": "4 spaces", "line_length": 88}, "javascript": {"indent": "2 spaces", "semicolons": "required"}, } tools = [{ "type": "function", "function": { "name": "get_project_convention", "description": "Read this project's formatting convention for a language.", "parameters": { "type": "object", "properties": { "language": { "type": "string", "enum": ["python", "javascript"], }, }, "required": ["language"], "additionalProperties": False, }, }, }] def run_tool(call): # Dispatch only the function this application deliberately exposes. if call.type != "function" or call.function.name != "get_project_convention": return {"error": "Unknown tool"} raw = call.function.arguments if len(raw) > 4096: return {"error": "Arguments are too large"} try: arguments = json.loads(raw) except json.JSONDecodeError: return {"error": "Arguments must be valid JSON"} if not isinstance(arguments, dict) or set(arguments) != {"language"}: return {"error": "Expected only a language argument"} language = arguments["language"] if not isinstance(language, str) or language not in CONVENTIONS: return {"error": "Choose python or javascript"} return CONVENTIONS[language] messages = [{ "role": "user", "content": "Use the project conventions to compare Python and JavaScript indentation.", }] request_ids = [] MAX_ROUNDS = 4 MAX_CALLS_PER_ROUND = 8 for _ in range(MAX_ROUNDS): response = client.chat.completions.create( model=model, messages=messages, tools=tools, tool_choice="auto", max_tokens=512, ) request_ids.append(response.id) if not response.choices: raise RuntimeError("The response contained no choices") choice = response.choices[0] if choice.finish_reason in {"length", "content_filter"}: raise RuntimeError("The response stopped before the example could finish") message = choice.message calls = message.tool_calls or [] if not calls: print(message.content or "No text was returned.") break if len(calls) > MAX_CALLS_PER_ROUND: raise RuntimeError("Tool-call limit reached") messages.append(message.model_dump(exclude_none=True)) for call in calls: messages.append({ "role": "tool", "tool_call_id": call.id, "content": json.dumps(run_tool(call)), }) else: raise RuntimeError("Round limit reached; inspect the conversation before continuing") ``` The model may request both languages in one response, across separate rounds, or return text without calling a tool. The loop handles all calls in each response before asking the model to continue. It makes at most four SDK requests, with automatic SDK retries disabled. `max_tokens=512` is an example output cap. If your chosen model requires `max_completion_tokens`, use the supported parameter instead. A round limit and output cap help bound the example; they do not establish a fixed credit cost. The example's control flow is checked with offline fixtures. It has not been run against the live VoidAI API. ## Adapt the example to your application Keep argument validation in your handler even when you supply a JSON schema. Treat model-selected arguments as untrusted input, and expose only the functions your application intends to offer. A production handler that writes files or changes an external service should apply its own authorization and confirmation rules before the action. Preserve the assistant message containing `tool_calls`, and return one result per call with the matching `tool_call_id`. Returning only the first result can leave the conversation incomplete. Keep tool results compact: they become input to a later model request and can consume context and credits. The example uses non-streaming responses so complete JSON arguments are available before execution. With streaming, assemble the tool-call argument fragments before parsing or invoking a function. Do not execute partial arguments. See the [SDK streaming guide](/guides/openai-sdk#streaming) for the basic stream format. ## Check usage and handle errors Each model request in the loop can be billed. Keep the response IDs in `request_ids` and use [request usage](/api-reference/usage/get) to inspect recorded charges. Use [current catalog prices](https://voidai.app/models) and the [credits guide](/guides/credits) to interpret input, output, and cache costs. If a model rejects `tools`, check its advertised endpoint and tool support, account eligibility, and the provider's error response. A capability flag is not a promise that every optional tool feature works on every provider. Follow the [error guide](/guides/errors) for authentication, access, and rate-limit responses. For the same kind of workflow in [Responses](/api-reference/responses/create) or [Messages](/api-reference/messages/create), use that API's own tool-input and tool-result format. The `role: "tool"` exchange above is specifically the Chat Completions format. # VoidAI API Documentation Source: https://docs.voidai.app/index Connect to VoidAI with OpenAI-compatible chat, Responses, and Anthropic Messages APIs. Find authentication, models, pricing, and endpoint references. VoidAI provides a unified API for models from multiple providers. Use the base URL `https://api.voidai.app/v1` with a VoidAI API key. Start with the [quickstart](/quickstart), or browse [models and current prices](https://voidai.app/models). Your account plan, balance, selected model, and endpoint determine which requests are available. Create a key and send your first chat request. Authenticate API requests and keep credentials on your server. Read model IDs, endpoint support, capabilities, and pricing fields. Understand input, output, cache, and fixed-cost billing. ## Choose an API format | Format | Reference | Typical use | | - | - | - | | OpenAI Chat Completions | [Chat completions](/api-reference/chat/completions) | Messages, streaming, and model-supported tools | | OpenAI Responses | [Responses](/api-reference/responses/create) | Responses-format requests and streaming | | Anthropic Messages | [Messages](/api-reference/messages/create) | Messages-format requests for supported models | | Images | [Generate](/api-reference/images/generations) and [edit](/api-reference/images/edits) | Models that advertise the matching image endpoint | | Audio | [Speech](/api-reference/audio/speech), [transcription](/api-reference/audio/transcriptions), and [translation](/api-reference/audio/translations) | Supported audio models | | Embeddings | [Create embeddings](/api-reference/embeddings/create) | Text vectors | Compatibility depends on the endpoint and model; not every provider feature is supported. Check the model's advertised `endpoints` and capability fields before sending a request. See the [OpenAPI specification](/api-reference/openapi.json) for the documented HTTP operations. ## Account and support Manage keys and account settings in the [dashboard](https://voidai.app/dashboard). See the [VoidAI website](https://voidai.app) for product information and [Discord](https://discord.gg/pQab7kukfu) for support. # VoidAI API Quickstart Source: https://docs.voidai.app/quickstart Create a VoidAI API key, configure the API base URL, and send an OpenAI-compatible chat request with Python, JavaScript, or cURL. ## 1. Create an API key Open the [VoidAI dashboard](https://voidai.app/dashboard) and create a key. Store it in a server-side environment variable named `VOIDAI_API_KEY`. Keep API keys out of browser code, public repositories, screenshots, and logs. Replace a compromised key from your dashboard. ## 2. Choose a model Browse [models and pricing](https://voidai.app/models), or query the public catalog: ```bash theme={null} curl https://api.voidai.app/v1/models ``` Use an exact model `id` that advertises `/v1/chat/completions`. Catalog presence does not guarantee access for your account. The examples below use `gpt-4o-mini`; replace it with a model available to your account. ## 3. Send a request ```python Python theme={null} # pip install openai import os from openai import OpenAI client = OpenAI( api_key=os.environ['VOIDAI_API_KEY'], base_url='https://api.voidai.app/v1', ) response = client.chat.completions.create( model='gpt-4o-mini', messages=[{'role': 'user', 'content': 'Explain what an API is in one sentence.'}], ) print(response.choices[0].message.content) ``` ```javascript JavaScript theme={null} // npm install openai import OpenAI from 'openai'; const client = new OpenAI({ apiKey: process.env.VOIDAI_API_KEY, baseURL: 'https://api.voidai.app/v1', }); const response = await client.chat.completions.create({ model: 'gpt-4o-mini', messages: [{ role: 'user', content: 'Explain what an API is in one sentence.' }], }); console.log(response.choices[0].message.content); ``` ```bash cURL theme={null} curl https://api.voidai.app/v1/chat/completions \ -H "Authorization: Bearer $VOIDAI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Explain what an API is in one sentence."}]}' ``` ## Next steps * Add [streaming with the OpenAI SDK](/guides/openai-sdk). * Explore [Responses](/api-reference/responses/create) or [Anthropic Messages](/api-reference/messages/create). * Review [credits and cache billing](/guides/credits) and [error handling](/guides/errors).