Skip to main content

Overview

Wafer is an OpenAI-compatible provider with a dedicated Bifrost provider implementation. Bifrost uses the shared OpenAI-compatible request and response converters, while preserving Wafer-specific extra parameters. Key characteristics:
  • OpenAI-compatible chat - Chat Completions use /chat/completions
  • Streaming support - Server-Sent Events for chat and text completions
  • Tool calling - Function tools are passed through using the OpenAI-compatible schema
  • Reasoning support - Reasoning models return reasoning via reasoning_content
  • Responses API - Supported by converting Responses requests to Chat Completions internally
  • Text completions - Text completions use Wafer’s /completions endpoint
  • File uploads - Upload media once and reference it by file_id in chat requests

Supported Operations

Setup & Configuration

Configure Wafer as a provider.
  1. Navigate to Models > Model Providers. Look for Wafer under Configured Providers. If it is missing, click on Add New Provider and select Wafer.
  2. Click Add Key or edit an existing key.
  3. Set a name for your key.
  4. Paste your API key directly or use an environment variable (for example, env.WAFER_API_KEY).
  5. Set Allowed Models to All Models (default) or the specific model allowlist you want this key to serve.
  6. To upload files, enable Use for Batch APIs on the key (this flag also gates file operations).
  7. Save the provider configuration.

1. Chat Completions

Request Parameters

Wafer supports OpenAI-compatible chat completion parameters. For the full parameter reference and message conversion behavior, see OpenAI Chat Completions. Available chat models include glm-5.2 and kimi-k2.6.

Reasoning Parameter

Wafer delegates through ToOpenAIChatRequest with provider-specific compatibility handling. Reasoning models return reasoning content via reasoning_content. Assistant-message reasoning details are stripped before sending follow-up messages because Wafer rejects reasoning_details in assistant messages.

Extra Parameters

Wafer enables passthrough extra parameters for chat and text completion requests. Provider-specific options can be sent through extra_params without being dropped by Bifrost.
Wafer fails fast on unsupported parameters, returning an error rather than silently ignoring them. Bifrost filters OpenAI-specific parameters before forwarding to avoid these rejections.

2. Responses API

Bifrost converts Responses API format to Chat Completions internally, then converts the response back:
Same parameter support as Chat Completions with response format differences (output items instead of message content). Streaming Responses requests are also routed through Chat Completions streaming.

3. Text Completions

Wafer supports text completions through /completions: Response returns choices[].text with completion text. Streaming text completions use Wafer’s OpenAI-compatible SSE format on /completions.

4. List Models

Lists available models from Wafer through /models.

5. File Upload

Upload a file once and reference it by file_id in later chat requests, avoiding per-request body size limits. Wafer accepts raw file bytes with metadata in HTTP headers (not a multipart form):
  • Content-Type - the file’s MIME type (required; validated against the purpose)
  • X-Wafer-Purpose - vision, document, or video (required)
  • X-Wafer-Filename - optional label
Uploads go to /files and return a file_id. Files expire after 30 days.
File operations reuse the batch key filter: only keys with Use for Batch APIs enabled are eligible. Enable it on at least one Wafer key, or uploads fail with no config found for batch apis.

Referencing a file in a chat completion

Reference an uploaded image by nesting its file_id inside image_url (in place of url):