---
title: "Developer quickstart for BroadNet Inference: Python and cURL"
description: "Send your first chat and transcription request to BroadNet Inference with Python or cURL, then work through the migration checklist for your chosen model."
url: https://broadrouter.com/developers/
lang: en
updated: 2026-11-15
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Developers

Updated 2026-11-15

BroadNet Inference uses the OpenAI request shapes at `https://inference.broadnet.ai/v1`. Create a key in the console, keep it in an environment variable, and send a request to `/chat/completions` or `/audio/transcriptions` with an exact model ID. Before you move production traffic, check parameters, streaming, tools, limits and errors for that model.

-   Chat quickstart
-   Transcription quickstart
-   Model IDs
-   Migration checklist
-   Errors and retries
-   Docs and guides

## How do I send my first chat request?

1.  Sign in at [inference.broadnet.ai](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=developers&utm_content=quickstart-account) and create an inference key. It is shown once; the console stores only its hash.
2.  Install the OpenAI SDK and set the key in your shell. Keep keys on your server, never in browser code.
3.  Send the request. Read the answer from `choices[0].message.content`.

_[image: A metal key whose bow is shaped like curly braces { }, entering a keyhole, beside the text "One API key. More possibilities." and "BroadRouter".]_

setup

```
python -m pip install openai
export BROADNET_API_KEY='paste-the-key-once'
```

first\_request.py

```
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://inference.broadnet.ai/v1",
    api_key=os.environ["BROADNET_API_KEY"],
)
response = client.chat.completions.create(
    model="broadnet/gemma-4-26b-a4b",
    messages=[{"role": "user", "content": "Reply with one short sentence."}],
)
print(response.choices[0].message.content)
```

request.sh

```
curl https://inference.broadnet.ai/v1/chat/completions \
  -H "Authorization: Bearer $BROADNET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"broadnet/gemma-4-26b-a4b","messages":[{"role":"user","content":"Reply with one short sentence."}]}'
```

The example uses BroadNet Gemma 4 VL 26B, which the $5 starting credit covers. DeepSeek V4.1 Flash, GLM 5.3 and Qwen3.8 27B need a top-up first. Keep the `X-Request-ID` response header for support.

How a request reaches a model

1.  01**Your app**Key kept in an environment variable
    
2.  02**OpenAI SDK**Two settings change
    
    `base_url` `api_key`
    
3.  03**BroadNet Inference**OpenAI-compatible API`inference.broadnet.ai/v1``POST /chat/completions`
    
4.  04**The model you name**Set in every request
    
    -   `broadnet/deepseek-v4.1-flash`
    -   `broadnet/glm-5.3`
    -   `broadnet/qwen3.8-27b`
    -   `broadnet/gemma-4-26b-a4b`your choice
    
5.  05**Response**From that model
    

You choose the model in each request. There is no automatic routing: the request runs on the model ID you sent.

Your app calls the OpenAI SDK with BroadNet’s base URL and your key. The request goes to BroadNet Inference with the model ID you wrote, and that model answers. Nothing picks or switches the model for you.

### Streaming

Set `stream=true` and read Server-Sent Events until `data: [DONE]`. With `stream_options.include_usage`, token usage arrives in the last chunk. If the stream ends before `[DONE]`, treat the answer as incomplete. BroadNet asks you to verify streaming per model before relying on it in production.

stream.sh

```
curl -N https://inference.broadnet.ai/v1/chat/completions \
  -H "Authorization: Bearer $BROADNET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"broadnet/gemma-4-26b-a4b","stream":true,"stream_options":{"include_usage":true},"messages":[{"role":"user","content":"Count from one to three."}]}'
```

## How do I transcribe audio?

Send WAV or MP3, up to 26,214,400 bytes per file, to `/audio/transcriptions`. Always set `language`: without it, Arabic can come back in Latin letters. Use `language=ar` for Arabic. Convert `.ogg` or `.m4a` first: `ffmpeg -i voice-note.ogg -ar 16000 -ac 1 voice-note.wav`

transcribe.py

```
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://inference.broadnet.ai/v1",
    api_key=os.environ["BROADNET_API_KEY"],
)
with open("recording.wav", "rb") as audio:
    result = client.audio.transcriptions.create(
        model="broadnet/cohere-transcribe-arabic",
        file=audio,
        language="ar",
    )
print(result.text)
```

transcribe.sh

```
curl https://inference.broadnet.ai/v1/audio/transcriptions \
  -H "Authorization: Bearer $BROADNET_API_KEY" \
  -F model=broadnet/cohere-transcribe-arabic \
  -F language=ar \
  -F file=@voice-note.wav
```

The response is JSON with the transcript in `text`. [Arabic or multilingual model, and what audio costs](https://broadrouter.com/arabic-transcription/).

## Which model IDs can I use?

Pass the exact ID as `model`. Don't rely on `/v1/models` to discover chat models; use this list or the [reference](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=developers&utm_content=models-docs#models).

| Model | ID | Endpoint | Input | Documented | Access |
| --- | --- | --- | --- | --- | --- |
| [DeepSeek V4.1 Flash](https://broadrouter.com/models/deepseek-v4.1-flash/) | `broadnet/deepseek-v4.1-flash` | `/chat/completions` | Text + Image | Reasoning | Top-up required |
| [GLM 5.3](https://broadrouter.com/models/glm-5.3/) | `broadnet/glm-5.3` | `/chat/completions` | Text | Tools, Structured output, Reasoning | Top-up required |
| [Qwen3.8 27B](https://broadrouter.com/models/qwen3.8-27b/) | `broadnet/qwen3.8-27b` | `/chat/completions` | Text + Image | Tools, Structured output, Reasoning | Top-up required |
| [BroadNet Gemma 4 VL 26B](https://broadrouter.com/models/gemma-4-vl-26b/) | `broadnet/gemma-4-26b-a4b` | `/chat/completions` | Text + Image | — | Starting credit |
| [BroadNet Transcribe Arabic](https://broadrouter.com/models/cohere-transcribe-arabic/) | `broadnet/cohere-transcribe-arabic` | `/audio/transcriptions` | Arabic audio | — | Starting credit |
| [BroadNet Transcribe](https://broadrouter.com/models/cohere-transcribe/) | `broadnet/cohere-transcribe` | `/audio/transcriptions` | Audio, 14 languages | — | Starting credit |

"Documented" lists the tools, structured output and reasoning that BroadNet's reference names for each model (checked 2026-11-15). A dash means the reference does not name them; it does not mean they are absent.

## Moving from another OpenAI-compatible API: checklist

The request shapes are familiar, but models differ. Work through each item for the model you chose, and test before you switch traffic.

1.  **Endpoint.** Set the base URL to `https://inference.broadnet.ai/v1`.
2.  **Key.** Use a BroadNet inference key from an environment variable. Plan keys and pay-as-you-go keys are separate.
3.  **Model ID.** Use the exact ID, for example `broadnet/gemma-4-26b-a4b`.
4.  **Parameters.** Check that every parameter you send is documented for that model. Remove ones it does not list.
5.  **Streaming.** Confirm your client reads SSE to `[DONE]` and handles a stream that ends early.
6.  **Tools and structured output.** The reference documents these for GLM 5.3 and Qwen3.8 27B. Test any other model before relying on them.
7.  **Reasoning.** Reasoning can use part of the output budget. Leave room in `max_tokens`; see [empty answers from reasoning models](https://broadrouter.com/guides/reasoning-tokens-empty-response/).
8.  **Limits.** A pay-as-you-go key allows 30 requests a minute and 4 in flight. A plan session allows one request at a time. A Gemma hourly key allows one stream, 120 requests a minute and 300,000 tokens a minute.
9.  **Context.** Context includes input and answer. Check the model's limit on its [model page](https://broadrouter.com/models/).
10.  **Errors.** Map the status codes below to retry or fix actions, and log `X-Request-ID`.
11.  **Costs.** Estimate with the [pricing calculators](https://broadrouter.com/pricing/). Images count as input tokens on pay-as-you-go.

## Which errors should I retry?

| Status | Meaning | Action |
| --- | --- | --- |
| 400 / 422 | Invalid request or field | Fix the request; don't retry as is |
| 401 | Missing, invalid or expired key, or exhausted allowance | Check the key and account |
| 402 | `insufficient_balance` | Top up, then retry |
| 413 | Request over the byte or text limit | Send less, for example a smaller audio file |
| 429 | Rate, concurrency, token-rate or spending limit | Back off with a bound, then retry |
| 500–504 | Server-side problem | Retry with bounded exponential backoff |

Summarised from the [reference's error table](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=developers&utm_content=errors-docs#errors), checked 2026-11-15. [Retry code examples](https://broadrouter.com/guides/errors-and-retries/).

## Where are the full docs and guides?

-   [**Developer reference**Request shapes, limits, errors and the price feed. The authoritative source.](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=developers&utm_content=docs)
-   [**Integrations**Settings for Aider, Cline, LangChain, n8n, LiteLLM and other OpenAI-compatible tools.](https://broadrouter.com/integrations/)
-   [**Guides**SDKs, streaming, retries, IP allow-lists and Arabic speech.](https://broadrouter.com/guides/)
-   [**Python SDK guide**Install, first request and streaming with the OpenAI Python SDK.](https://broadrouter.com/guides/openai-python-sdk/)
-   [**Node SDK guide**The same in JavaScript and TypeScript, with request IDs.](https://broadrouter.com/guides/openai-node-sdk/)
-   [**cURL quickstart**Every request from the shell.](https://broadrouter.com/guides/curl-quickstart/)
-   [**Keys and IP allow-lists**Lock keys to your servers.](https://broadrouter.com/guides/api-keys-ip-allow-lists/)
-   [**API request builder**Build a request in your browser and copy it.](https://broadrouter.com/tools/api-request-builder/)

Need a private endpoint or a model that is not listed? [Contact BroadNet](https://broadrouter.com/contact/#private).

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=developers&utm_content=page-cta) ·

**Sources**

-   [BroadNet Inference developer reference (checked 2026-11-15)](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=developers&utm_content=sources)
-   [BroadNet Inference pricing](https://inference.broadnet.ai/pricing?utm_source=broadrouter&utm_medium=referral&utm_campaign=developers&utm_content=sources)
-   [pricing.json, the published rate card](https://inference.broadnet.ai/pricing.json?utm_source=broadrouter&utm_medium=referral&utm_campaign=developers&utm_content=sources)
