Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions docs/llmservice/api/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ The request structure of the Responses API differs from Chat Completions:

### Model and Endpoint Compatibility

The Responses endpoint accepts models enabled for this protocol. If the model and endpoint are incompatible, the server returns HTTP `400` with error details.
The Responses endpoint supports GPT and DeepSeek model families available through B.AI. Use `GET /v1/models` to retrieve the model IDs available to the current API credential. Supported parameters and tools vary by model; if the model and endpoint are incompatible, the server returns HTTP `400` with error details.

DeepSeek models do not support web search. When calling a DeepSeek model through the Responses API, do not include a web search tool in the request. When using a DeepSeek model in Codex, set the top-level Codex option `web_search = "disabled"`.

### Request Body

Expand Down Expand Up @@ -669,7 +671,7 @@ When `stream: true`, common events include:

## Codex CLI Integration

The B.AI Responses API can be used as a custom model provider for Codex. The following configuration applies to Codex versions that support custom model providers.
The B.AI Responses API can be used as a custom model provider for Codex with supported GPT and DeepSeek model families. The following configuration applies to Codex versions that support custom model providers.

### 1. Set the API Key

Expand Down Expand Up @@ -699,6 +701,20 @@ wire_api = "responses"
requires_openai_auth = false
```

:::caution Disable Codex web search before using DeepSeek
Codex may expose its built-in web search tool by default, but DeepSeek models do not support that tool. Without this setting, the request may return an unsupported Web Search tool error.

Open `~/.codex/config.toml` and add `web_search = "disabled"` as a top-level option:

```toml
model = "your-model-id"
model_provider = "bai"
web_search = "disabled"
```

Keep `web_search` above and outside the `[model_providers.bai]` block. Save the file, fully quit Codex, and restart it. This setting is required when using DeepSeek; remove or change it when switching to a model configuration that uses web search.
:::

If the file already contains configuration, append the complete `[model_providers.bai]` block and change the top-level `model` and `model_provider` values as shown above. See the Codex documentation at the end of this page for a full explanation of the configuration fields.

After saving, start Codex from a terminal where `BAI_API_KEY` is set:
Expand All @@ -722,6 +738,7 @@ model = "your-model-id"
| `401` response | Check whether the API Key is valid and whether a Key from another environment was used accidentally. |
| `403` response | Check the account status and model permissions. |
| Model not supported | Confirm that the model ID is spelled correctly and is enabled for the configured endpoint. |
| DeepSeek request reports an unsupported web search tool | Confirm that the top-level configuration contains `web_search = "disabled"`, then restart Codex. |

---

Expand Down Expand Up @@ -788,6 +805,7 @@ Error responses include an HTTP status code and an `error` object. Applications
| Scenario | Status code | Handling |
|---|---:|---|
| Model and endpoint are incompatible | `400` | Select a model enabled for the endpoint or use another endpoint. |
| A DeepSeek request includes web search | `400` | Remove the web search tool. In Codex, set the top-level option `web_search = "disabled"`. |
| `max_tokens` or `max_completion_tokens` is used | `400` | Use `max_output_tokens` instead. |
| `max_output_tokens` exceeds the model limit | `400` | Adjust the value to the range stated in the error. |
| Request uses an unavailable tool | `400` | Remove the tool or choose a compatible model configuration. |
Expand Down
56 changes: 56 additions & 0 deletions docs/llmservice/models/claude-fable-5-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Claude Fable 5.1

## Overview

Claude Fable 5.1, released by Anthropic on September 1, 2026, is a generally available Mythos-class model in the Claude 5 family for demanding reasoning and long-horizon agentic work. It shares its underlying model with the limited-access Claude Mythos 5.1. On B.AI, use the model ID `claude-fable-5-1`.

## Key Features

* **Long-Horizon Agentic Performance:** Anthropic reports 52.6% on Terminal-Bench-Science 0.1, 55.8% on Terminal-Bench 4.0, 31.4% on AutomationBench, and 73.4% on CursorBench 3.2.0 with production safeguards enabled.
* **Always-On Adaptive Thinking:** Adaptive thinking cannot be disabled. The `effort` control supports `low`, `medium`, `high`, `xhigh`, and `max`, with `high` as the Claude API default.
* **1M Context and 128K Output:** Provides a 1,000,000-token context window and up to 128,000 output tokens at standard per-token pricing across the full window.
* **Agent-Oriented API Controls:** Supports automatic tool use, strict tool schemas, structured output, preserved thinking, per-message effort, turn-scoped system messages, readable progress updates, and content provenance. Several of these controls are beta features.
* **Lower Cache-Read Cost:** Cache hits and refreshes cost 0.25 Credits/Token, one quarter of the Claude Fable 5 cache-read rate, while base input and output prices remain unchanged.

## Best Use Cases

* **Long-Running Software Engineering:** Repository-scale implementation, debugging, code review, performance work, and autonomous sessions that span many tools and checkpoints.
* **Multi-Step Research and Analysis:** Research workflows that require search, evidence synthesis, iterative hypothesis testing, and recovery from failed steps.
* **Enterprise Knowledge Work:** Complex document, spreadsheet, presentation, financial-analysis, and cross-file workflows that benefit from a large context window and vision.
* **Browser and Computer-Use Agents:** Tasks that operate across applications, maintain state over extended sessions, and provide progress updates between tool calls.

## Capabilities and Limitations

| Capability | Description |
| :--- | :--- |
| **Reasoning** | Always-on adaptive thinking with five effort levels. Anthropic reports 60.9% on Humanity's Last Exam without tools and 65.0% with tools. |
| **Creative Writing** | Supports drafting, editing, research synthesis, and professional artifact creation. |
| **Multimodal** | Accepts text and image input and produces text output. It can analyze charts, diagrams, tables, files, and PDFs. |
| **Context Window** | 1M tokens. |
| **Max Output** | 128,000 tokens. |
| **Tool Use** | Supports automatic function calling, strict tool use, structured output, browser and computer-use workflows, and preserved thinking. Forced `any` or named-tool selection is not supported. |
| **Multilingual** | Anthropic lists multilingual support across current Claude models. |
| **Knowledge Cutoff** | Reliable knowledge cutoff and training-data cutoff: June 2026. |

### Known Limitations

* Forced tool choice is not supported. Setting `tool_choice` to `any` or to a named tool returns a 400 error; integrations should use `auto` or `none` and express required tool behavior in the prompt.
* Thinking blocks are forward-compatible only: Claude Fable 5.1 can read thinking blocks from earlier models, but earlier models cannot read its thinking blocks.
* Editing the system prompt, tool definitions, or earlier messages after a Fable 5.1 thinking block can invalidate that block. Long-running integrations should treat conversation history as append-only or use the documented block-dropping controls.
* The model is comparatively slow and costs twice as much per base input and output token as Claude Opus 5.
* Fable safeguards may refuse or route some cybersecurity and biology requests to another Claude model. Fable 5.1 also requires 30-day data retention by default; zero-data-retention use requires express authorization from Anthropic.
* Priority Tier is not supported for Claude Fable 5.1.

## Pricing

| Model | Input (Credits/Token) | 5m Cache Write (Credits/Token) | 1h Cache Write (Credits/Token) | Cache Read (Credits/Token) | Output (Credits/Token) | Web Search (Credits/Use) |
| :--- | --------------------: | -----------------------------: | -----------------------------: | -------------------------: | ---------------------: | -----------------------: |
| **Claude Fable 5.1** | `10.00` | `12.50` | `20.00` | `0.25` | `50.00` | `-` |

:::info Caching note
For Claude Fable 5.1, a 5-minute cache write is billed at 1.25x the input rate and a 1-hour cache write is billed at 2x. Cache reads are billed at 0.025x the input rate.
:::

:::info Pricing note
Prices shown in the documentation are B.AI standard reference prices for base billing purposes. B.AI may provide lower actual usage costs through top-up bonuses and account benefits. Specific prices, bonus Credits, and account benefits are subject to the platform display and final billing records.
:::
67 changes: 67 additions & 0 deletions docs/llmservice/models/deepseek-v4-flash-vision-exp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import ActivityCard from '@site/src/components/ActivityCard';

# DeepSeek-V4-Flash-Vision-Exp

<ActivityCard
variant="discount"
title="DeepSeek-V4-Flash-Vision-Exp"
status="Limited-Time API Discount"
detail="50% of Standard Price"
>
The DeepSeek-V4-Flash-Vision-Exp 50% offer takes effect at 17:00 on September 3, 2026 (UTC+8).

From the effective time, eligible `deepseek-v4-flash-vision-exp` API usage is billed at 50% of the standard price for the applicable Idle or Busy period. The discounted price changes in step with DeepSeek's time-based pricing and remains at 50% in either period.

The pricing table below continues to show standard reference prices. Actual settlement and final billing are subject to the platform display.
</ActivityCard>

## Overview

DeepSeek-V4-Flash-Vision-Exp is DeepSeek's first experimental multimodal model in the DeepSeek-V4 family, released on August 21, 2026. It extends DeepSeek-V4-Flash with visual modules and continued training for image understanding while retaining comparable text-only agent performance in DeepSeek's evaluations.

## Key Features

- **Native Image Understanding**: Accepts interleaved text and image input in JPEG, PNG, GIF, and WebP formats for screenshot reading, chart analysis, visual question answering, and other image-grounded tasks.
- **Multimodal Agent Evaluation**: DeepSeek reports 36.5 on ApexBench (Pass@1), 64.3 on Chartography, and 35.0 on ZeroBench (Pass@5), indicating stronger visually grounded agent performance than the text-only DeepSeek-V4-Flash-0731 baseline in its published evaluation.
- **Text-Agent Continuity**: DeepSeek reports text-only capabilities comparable to DeepSeek-V4-Flash, including 83.9 on Terminal-Bench 2.1, 59.3 on DeepSWE, and 75.9 on Toolathlon-Verified.
- **Long-Context Reasoning**: The hosted API provides a 1M-token context window, up to 384K output tokens, optional thinking, and `low`, `high`, or `max` reasoning effort.
- **Agent-Oriented API Support**: Supports tool calls, JSON output, context caching, Chat Prefix Completion, and OpenAI-compatible Chat Completions and Responses interfaces, as well as an Anthropic-compatible Messages interface.
- **Open-Weight Reference Release**: The official MIT-licensed repository lists a 305B-parameter checkpoint and includes reference code for the vision encoder and aligner, DFlash attention, mixture-of-experts layers, Hyper-Connections, and the DSpark forward path.

## Best Use Cases

- **Visual Software Agents**: Inspecting screenshots, rendered interfaces, dashboards, or canvas state while using tools to modify code or other artifacts.
- **Document and Chart Analysis**: Reading text from screenshots, interpreting charts, and answering questions grounded in visual business or technical material.
- **Multimodal Tool Workflows**: Processing images returned by tools through the Responses API and combining visual evidence with multi-step reasoning and function calls.
- **Large Visual Review Batches**: Handling many images in one request when applications need consistent analysis across collections of screenshots, pages, or frames.
- **Open-Weight Evaluation**: Testing DeepSeek's experimental V4 vision architecture in controlled self-hosted research environments where the large checkpoint and reference-runtime requirements are acceptable.

## Capabilities and Limitations

| Capability | Description |
| :--- | :--- |
| **Reasoning** | Supports thinking and non-thinking modes; thinking is enabled by default at `high` effort. The primary effort levels are `low`, `high`, and `max`; compatible `medium` and `xhigh` requests map to `high`. |
| **Coding and Agents** | DeepSeek reports Terminal-Bench 2.1: 83.9, DeepSWE: 59.3, and Toolathlon-Verified: 75.9. These are provider-run evaluations using DeepSeek Harness minimal mode, `max` effort, `temperature = 1.0`, and `top_p = 0.95`. |
| **Tool Use** | Supports function calling in thinking and non-thinking modes, JSON output, context caching, and image-bearing tool outputs through the Responses API. |
| **Multimodal** | Accepts text and image input and produces text output. Each image is resized before inference and uses at most 384 input tokens; the API accepts up to 600 images per request within its size limits. |
| **Context Window** | 1M tokens. |
| **Max Output** | 384K tokens. |

### Known Limitations

- Image placement is interface-dependent: Chat Completions accepts images in `user` messages, while the Responses API also accepts them in `developer` messages and supported tool outputs. Images in `system` or `assistant` messages are rejected.
- The documented multimodal route accepts images but does not document audio or video input, image generation, or other non-text output.
- FIM Completion is not supported. Chat Prefix Completion remains a beta feature.
- In thinking mode, `temperature`, `top_p`, `presence_penalty`, and `frequency_penalty` have no effect. Tool-calling conversations must pass the full prior `reasoning_content` back on subsequent requests.
- DeepSeek does not publish a model-specific knowledge cutoff or a complete supported-language list.

## Pricing

| Billing Period | Input (Credits/Token) | Cache Write (Credits/Token) | Cache Read (Credits/Token) | Output (Credits/Token) |
| :--- | ---: | ---: | ---: | ---: |
| **Idle** | 0.22 | 0.22 | 0.0073 | 0.66 |
| **Busy** | 0.44 | 0.44 | 0.0147 | 1.32 |

API calls use UTC+8. Busy periods are 09:00-12:00 and 14:00-18:00, Monday through Friday; all other times, including weekends, are Idle periods.

Images are converted to input tokens according to their dimensions and billed together with text input; each image uses at most 384 tokens after resizing.
15 changes: 7 additions & 8 deletions docs/llmservice/models/deepseek-v4-flash.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ import ActivityCard from '@site/src/components/ActivityCard';
DeepSeek-V4-Flash is DeepSeek's high-efficiency open-source language model, released alongside V4-Pro on April 24, 2026 under the MIT License. With 284 billion total parameters and only 13 billion active parameters, it delivers performance within striking distance of V4-Pro at roughly 3.1x lower cost, making it one of the most cost-effective models available.

<ActivityCard
variant="free"
variant="discount"
title="DeepSeek-V4-Flash"
status="Free Offer"
detail="0 Credits"
status="Limited-Time API Discount"
detail="50% of Standard Price"
>
Offer starts August 17, 2026, and applies to DeepSeek-V4-Flash on B.AI Chat and API.
The DeepSeek-V4-Flash 50% offer takes effect at 17:00 on September 3, 2026 (UTC+8).

* **Chat:** Usage is billed at `0 Credits` during the offer.
* **API:** Usage is billed at `0 Credits` during the offer. No per-request, input, cache write, cache read, or output token fees apply.
From the effective time, eligible DeepSeek-V4-Flash API usage is billed at 50% of the standard price for the applicable period. The discounted price changes in step with DeepSeek's Idle and Busy pricing periods and remains at 50% in either period.

After the offer ends, the model will return to standard pricing. Offer end time, eligibility, actual charges, and final billing are subject to the platform display.
The pricing table below continues to show standard reference prices. Actual settlement and final billing are subject to the platform display.
</ActivityCard>

## Key Features
Expand Down Expand Up @@ -60,5 +59,5 @@ After the offer ends, the model will return to standard pricing. Offer end time,
| **Busy** | `0.44` | `0.44` | `0.0147` | `1.32` | `-` | Cache Write: `1x` input; Cache Read: `0.0333x` input |

:::info Pricing note
The table shows the time-based standard reference price for DeepSeek-V4-Flash. Under DeepSeek's updated rule, from 00:00 UTC+8 on August 23, 2026, Saturdays and Sundays are billed at Idle rates all day. Its current limited-time offer applies `0 Credits` to all B.AI Chat and API usage. After the offer ends, the applicable weekday Idle or Busy period, final settlement price, and billing records are subject to the platform display. B.AI may provide lower actual usage costs through top-up bonuses and account benefits.
The table shows the time-based standard reference price for DeepSeek-V4-Flash. API calls use UTC+8: Busy periods are 09:00-12:00 and 14:00-18:00, Monday through Friday; all other times, including weekends, are Idle periods. DeepSeek-V4-Flash usage in B.AI Chat is billed at Idle rates. From 17:00 on September 3, 2026 (UTC+8), eligible API usage is billed at 50% of the standard price for the applicable period. Final settlement prices and billing records are subject to the platform display. B.AI may provide lower actual usage costs through top-up bonuses and account benefits.
:::
2 changes: 1 addition & 1 deletion docs/llmservice/models/deepseek-v4-pro.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ DeepSeek-V4-Pro is DeepSeek's flagship open-source large language model, release
| **Busy** | `1.32` | `1.32` | `0.044` | `3.96` | `-` | Cache Write: `1x` input; Cache Read: `0.0333x` input |

:::info Pricing note
DeepSeek V4 Pro uses time-based standard reference pricing. Under DeepSeek's updated rule, from 00:00 UTC+8 on August 23, 2026, Saturdays and Sundays are billed at Idle rates all day. The applicable weekday Idle or Busy period, final settlement price, and billing records are subject to the platform display. B.AI may provide lower actual usage costs through top-up bonuses and account benefits.
DeepSeek V4 Pro uses time-based standard reference pricing. API calls use UTC+8: Busy periods are 09:00-12:00 and 14:00-18:00, Monday through Friday; all other times, including weekends, are Idle periods. DeepSeek V4 Pro usage in B.AI Chat is billed at Idle rates. Final settlement prices and billing records are subject to the platform display. B.AI may provide lower actual usage costs through top-up bonuses and account benefits.
:::
Loading
Loading