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
27 changes: 27 additions & 0 deletions docs/llmservice/app-and-service-availability.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# B.AI Android App and Service Availability

The B.AI Android App integrates core B.AI functions and pages. It also provides **B.AI Service Availability**, where users can find Web access URLs and API Base URLs available for their current network environment. This is useful for users in mainland China and other network environments where the primary B.AI Web or API address cannot be reached directly.

## Download the App

The B.AI Android App requires Android 8.0 or later. Use either of the following official installation methods:

- **Google Play:** [Install B.AI from Google Play](https://play.google.com/store/apps/details?id=com.bai.chat).
- **Official APK:** Visit the [B.AI official website](https://b.ai/) and scan the Android download QR code in the upper-right corner.

The official APK download QR code is also shown below for convenience:

![B.AI for Android APK download QR code](/img/bai-android-download-qr.png)

Install the App only through the Google Play listing above or the QR code provided by the official B.AI website.

## View Available Service Addresses

Open the B.AI Android App and select **B.AI Service Availability**. The page provides:

- **Web access URLs:** Open an available address to use B.AI Web services.
- **API Base URLs:** Copy an available address into the Base URL field of your API client or integration.

When configuring an API client, copy the complete API Base URL displayed in the App without manually adding or removing path segments. For authentication, request protocols, and examples, see the [API Reference](./api/API.md).

Service-specific addresses are maintained in the App rather than duplicated in this document. Reopen **B.AI Service Availability** whenever you need to check the available addresses for your network environment.
135 changes: 135 additions & 0 deletions docs/llmservice/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Frequently Asked Questions (FAQ)

## 1. What is the difference between B.AI Chat and the API?

Chat lets you converse directly through the website or app. The API lets developers integrate models into their applications or tools. Available models, features, and billing rules may differ; see the relevant documentation for each service.

## 2. How do I obtain and use an API Key?

Create an API Key in the [B.AI console](https://chat.b.ai/key), then configure it in your application or client. Authenticate requests using `Authorization: Bearer <API Key>` or `x-api-key`. Keep your key private and avoid exposing it in screenshots, logs, or source repositories. See the [API Reference](./api/API.md).

## 3. Which API Base URL should I use?

The production Base URL is `https://api.b.ai/v1`. Choose the request endpoint according to your client's protocol; supported endpoints may vary by model. See the [API Reference](./api/API.md).

## 4. What can I do if I cannot access B.AI from mainland China?

Open **B.AI Service Availability** in the B.AI Android app to find currently available web addresses and API Base URLs. Copy the displayed address in full. See [App and Service Availability](./app-and-service-availability.md).

## 5. Where can I download the B.AI app?

Install it through [Google Play](https://play.google.com/store/apps/details?id=com.bai.chat), or scan the Android download QR code in the upper-right corner of the [B.AI website](https://b.ai/) to download the APK. Android 8.0 or later is supported. See [App and Service Availability](./app-and-service-availability.md).

## 6. What if I do not know which model to choose?

Select Auto in Chat to let B.AI choose an available model for each task. You can select a model manually when you need a fixed model or want to test its capabilities. Auto has no additional selection fee; billing follows the model actually used and its usage. See [Auto Mode](./auto-mode.md).

## 7. How do I fill in the model name in an API request?

Open the [API Key page](https://chat.b.ai/key), find the model you want to use, and select the copy button to the right of its name. Paste the copied model ID into the request's `model` field.

You can also use `GET /v1/models` to retrieve the models available to your current API Key. Confirm that the selected model supports the endpoint you are using. See the [API Reference](./api/API.md).

## 8. How are input, output, cache writes, and cache reads billed?

Input is the content sent to the model, and output is the content it generates. Cache writes create reusable cached content, while cache reads reuse it in later requests. Rates, cache durations, and billing behavior vary by model. Some models also count reasoning tokens as output usage. See the relevant model details.

## 9. How do explicit and implicit caching differ? Are there extra charges?

Explicit caching typically involves caches created or specified by the caller. Implicit caching automatically identifies reusable content. Both may incur cache write or read charges, and some models also charge for explicit cache storage based on its duration. See the model details for supported caching options and rates.

## 10. Does web search incur an additional charge?

Web search is billed separately per use, with rates varying by model. Search results included in the model's context may also incur token charges. Check the model's web search pricing and your usage records.

## 11. Why might my actual charge differ from the documented price?

Model prices in the documentation are based on the model providers' official list prices and serve as B.AI standard reference prices. B.AI may offer discounts or limited-time promotions on this basis; offer details are shown in [Promotions and Pricing Updates](./promotions-and-pricing-notices.md) and the website's discount groups. Applicable prices, offer terms, and final charges are subject to the platform display and actual billing records.

Actual charges may also depend on cache hits, context tiers, time-based pricing, and tool usage. See [Pricing and Usage](./pricing-and-usage.md).

## 12. How long do discounted prices last? {#discount-duration}

Discount promotions may start, change, or end in line with suppliers' promotional arrangements, without further notice. The validity period is subject to the promotion details. Before running large batch jobs, check the current prices displayed on **B.AI platform pages and discount groups**.

## 13. How do long-context rates and DeepSeek Peak and Off-Peak pricing work? {#12-how-do-long-context-rates-and-deepseek-peak-and-off-peak-pricing-work}

Some models apply different rates when input exceeds a specified length. See the model details for the threshold and which parts of the request those rates cover.

For DeepSeek models with time-based pricing, Peak periods are Monday through Friday, excluding Chinese statutory public holidays, from 09:00-12:00 and 14:00-18:00 Beijing Time (UTC+8). All other periods, including weekends and Chinese statutory public holidays, are Off-Peak. Off-Peak prices are half the Peak prices. B.AI Chat always uses Off-Peak pricing for these models. See [Pricing and Usage](./pricing-and-usage.md).

## 14. How do I check my balance and actual charges? {#13-how-do-i-check-my-balance-and-actual-charges}

Use the platform's Usage page to view your balance, the model actually used, token usage, and Credits consumed. Developers can also use the [Balance API](./api/balance.md) to query the balance or quota available to the current API Key.

## 15. Why were Credits deducted when the model did not provide an answer? {#14-why-were-credits-deducted-when-the-model-did-not-provide-an-answer}

Model charges are based on actual billable usage, including input, output, cache writes, and cache reads. Having no visible answer does not necessarily mean there was no usage: the request may already have processed input tokens, and some reasoning models may generate reasoning tokens that are not displayed to the user. Such usage may still be billable.

Check the usage records on the Usage page for the actual charge. If you have a question about a charge, keep the request time and relevant records to help investigate it.

## 16. How should I troubleshoot API errors? {#15-how-should-i-troubleshoot-api-errors}

Read the error message in the response, then check the following based on its status code:

| Status code | What to check |
| :--- | :--- |
| `400` | Parameters, request format, and model compatibility with the endpoint |
| `401` | API Key and authentication headers |
| `403` | Account status, subscription, or model permissions |
| `404` | Request path and model ID |
| `429` | Request rate and concurrency; reduce concurrency and retry with exponential backoff |
| `500 / 502 / 503` | Retry later and retain the request ID for investigation |

See the [API Reference](./api/API.md).

## 17. Why can a request fail even when the input is below the model's stated context limit? {#16-why-can-a-request-fail-even-when-the-input-is-below-the-models-stated-context-limit}

**B.AI does not impose an additional context-length limit.** Requests must still follow the rules of the model and its upstream API.

The stated context capacity is not necessarily available entirely for the main input text. System prompts, conversation history, and tool-related content also consume space, and some APIs reserve capacity for output. Client-side token estimates may also differ from server-side counts, so the length of the main text alone cannot determine whether a request exceeds the limit.

Trim conversation history, set the maximum output length according to your needs, and leave some context capacity available. If length-related errors persist, split oversized content into smaller parts or extract the key information before submitting it.

## 18. Why does the Responses API report cache read usage but no cache write usage? {#17-why-does-the-responses-api-report-cache-read-usage-but-no-cache-write-usage}

Some models use **implicit caching**, which is managed automatically by the upstream service without explicit client configuration. Usage fields may also vary between upstream services, and some responses include only cache read usage without a separate cache write field.

**A missing write field does not mean caching was ineffective.** Cache read usage greater than 0 indicates that the request hit the cache, but the response alone cannot determine how much new content was written to the cache.

## 19. Why does my bill show models I did not actively select or do not remember calling? {#18-why-does-my-bill-show-models-i-did-not-actively-select-or-do-not-remember-calling}

Not actively selecting a model does not necessarily mean your client did not call it. Some clients or tools may call other models for automatic model selection, conversation history compression, subtasks, or background workflows. Multiple applications sharing the same API Key may also generate usage across different models.

These are possible causes, not confirmed explanations for a particular charge. To identify the source, compare the call time, model, and API Key in your billing records with your client configuration, past conversations, and background tasks.

## 20. Why did I not receive bonus Credits after topping up? {#19-why-did-i-not-receive-bonus-credits-after-topping-up}

The top-up bonus promotion has ended. No payment method provides additional bonus Credits on top-ups. Bonus Credits received through previous top-up promotions are valid for **30 days**. We recommend using them within their validity period.

Registration through any channel does not grant bonus Credits. Inviting someone to register does not grant bonus Credits either.

## 21. Why can Credits consumption differ severalfold for the same model and seemingly identical context? {#20-why-can-credits-consumption-differ-severalfold-for-the-same-model-and-seemingly-identical-context}

Credits consumption depends on the actual billable usage and applicable rates for each request. Seemingly identical context does not necessarily mean that the content sent or the usage is exactly the same. Common reasons include:

1. **Different actual input usage:** The client may include conversation history, system prompts, and tool results. Input is not limited to the text you just sent.
2. **Different cache hit proportions:** Reported cache read usage does not mean that all input was cached. Ordinary input and cache reads may have different rates, so charges can differ significantly even when total input usage is similar. Cache hits are not guaranteed on every request.
3. **Different output usage:** Output is still billed based on actual usage after a cache hit. Some models also include undisplayed reasoning tokens in billable output usage, so visible answer length alone cannot determine the charge.

**A difference in Credits consumption alone cannot establish that you were overcharged.** Compare the billable usage for ordinary input, cache writes and reads, and output, along with the context tier, time-based rates, and promotional discounts applicable when each request was made.

## 22. Why do consecutive calls to the same model sometimes hit the cache and sometimes miss it? Is my configuration wrong? {#21-why-do-consecutive-calls-to-the-same-model-sometimes-hit-the-cache-and-sometimes-miss-it-is-my-configuration-wrong}

**Not necessarily.** Cache hits typically depend on reusable input content and the applicable caching conditions. Calling the same model repeatedly does not guarantee a cache hit. Common factors include:

- **Changes to the input prefix:** The content or order of system prompts, conversation history, or tool definitions changes.
- **Insufficient cacheable length:** The identical input prefix does not meet the model's minimum cache length.
- **Cache expiration:** The cache has expired or been cleared by the system.
- **Explicit caching conditions are not met:** The initial cache creation has not finished, or the position of the cache marker does not satisfy the matching rules.

**To improve the cache hit rate:** Place fixed system prompts, reference material, and tool definitions at the beginning of the request, followed by the changing user question. Keep fixed content and tool order consistent, and avoid inserting changing timestamps or random values into the fixed prefix.

**Qwen example:** For models and endpoints that support the corresponding caching mechanism, implicit caching requires no extra configuration but does not guarantee a hit on every request. Explicit caching requires parameters such as `cache_control` to be configured according to the endpoint, along with the cache creation and matching conditions. Configuration may differ between endpoints. See the [Qwen official caching documentation](https://www.alibabacloud.com/help/en/model-studio/context-cache).

Caching mechanisms, validity periods, and supported parameters vary by model.
58 changes: 58 additions & 0 deletions docs/llmservice/models/gemini-4-neon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Gemini 4 Neon

## Overview

Gemini 4 Neon is a multimodal reasoning model that Google DeepMind released on November 18, 2026. Adapted from Gemini 4 Carbon, it sits between Hydrogen and Carbon in the Gemini 4 family and is designed to complete complex coding, analysis, and multi-step workflows quickly.

## Key Features

- **Multi-file coding** across implementation, debugging, and verification with tests.
- **Tool-assisted workflows** that carry results from one step into the next and adapt to user feedback during a task.
- **Multimodal analysis** that draws on documents, images, audio, and recorded video in the same request.
- **Adjustable reasoning** to balance response time and token use against the difficulty of the task.
- **Long decode** for tasks that need more generation capacity than a single synchronous response allows.

## Best Use Cases

- **Software maintenance** for tracing regressions across modules, implementing fixes, and checking them against existing tests.
- **Technical document review** for comparing specifications, diagrams, and recordings to extract requirements or identify inconsistencies.
- **Scientific and quantitative analysis** for exploring mathematical problems and explaining patterns in datasets or charts.
- **Workflow automation** for gathering information, validating it with tools, and returning records that downstream systems can use.

## Capabilities and Limitations

| Capability | Description |
| :--- | :--- |
| **Inputs and Output** | Accepts text, images, video, audio, and PDFs, and produces text. |
| **Context Window** | Shares 1,048,576 tokens across input, thinking, and output. |
| **Generation Limit** | The default synchronous limit is 65,536 tokens of thinking and output. Long decode can use the remaining context budget through background execution or continuation. [Long decode guide](https://aistudio.google.com/docs/long-decode) |
| **Thinking Levels** | Supports `low`, `medium`, `high` (default), and `xhigh`. |
| **Tool Use** | Google's Gemini API supports function calling, code execution, file search, URL context, search and map grounding, and computer use. |
| **Structured Output** | Supports JSON responses constrained by a schema. |
| **Video Understanding** | Uses static processing by default and supports optional agentic video understanding in the Gemini API. |
| **Prompt Caching** | The Gemini API supports automatic prefix caching for eligible prompts of at least 4,096 tokens. |

### Known Limitations

- **Reasoning cost and latency.** The `xhigh` level can take longer and use more tokens. Difficult prompts can take several minutes.
- **Sampling controls.** The Gemini API uses fixed sampling settings and ignores valid custom `temperature`, `top_p`, and `top_k` values.

## Standard Pricing

The token prices below are shown in USD per 1 million tokens; web search is billed in USD per use.

| Model | Input<br/>(USD / 1M Tokens) | Cache Write<br/>(USD / 1M Tokens) | Cache Read<br/>(USD / 1M Tokens) | Output<br/>(USD / 1M Tokens) | Web Search<br/>(USD / use) |
| :--- | ---: | ---: | ---: | ---: | ---: |
| Gemini 4 Neon | `$3.00` | `$3.00` | `$0.15` | `$15.00` | `$0.014` |

**Credits settlement:** B.AI converts charges at `1 USD = 1,000,000 Credits` and deducts Credits from the account balance.

Web search costs `14,000 Credits` per use, equivalent to `$0.014` per use.

:::info Caching note
For this model on B.AI, cache writes are priced at 1x the input rate. This model supports implicit caching only; the cache-write price shown in the table does not imply support for explicit cache creation. Google's implicit caching requires prompts of at least 4,096 tokens; meeting that threshold does not guarantee a cache hit on every request.
:::

:::info Pricing note
Model prices in the documentation are based on the model providers' official list prices and serve as B.AI standard reference prices. B.AI may offer discounts or limited-time promotions on this basis; offer details are shown in [Promotions and Pricing Updates](../promotions-and-pricing-notices.md) and the website's discount groups. Applicable prices, offer terms, and final charges are subject to the platform display and actual billing records.
:::
1 change: 1 addition & 0 deletions docs/llmservice/pricing-and-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ The token prices below are shown in USD per 1 million tokens; web search is bill
| Claude Sonnet 4.5 | `$3.00` | `$3.75` | `$0.30` | `$15.00` | `$0.01` |
| Claude Haiku 4.5 | `$1.00` | `$1.25` | `$0.10` | `$5.00` | `$0.01` |
| Muse Spark 1.3 | `$1.25` | `$1.25` | `$0.15` | `$4.25` | - |
| Gemini 4 Neon | `$3.00` | `$3.00` | `$0.15` | `$15.00` | `$0.014` |
| Gemini 4 Hydrogen | `$1.50` | `$1.50` | `$0.075` | `$7.50` | `$0.014` |
| Gemini 4 Carbon | `$4.00` | `$4.00` | `$0.20` | `$20.00` | `$0.014` |
| Gemini 4 Argon | `$2.00` | `$2.00` | `$0.10` | `$10.00` | `$0.014` |
Expand Down
Loading
Loading