Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
eb6337f
feat(agentkit): add preview endpoint support and the Gemini preview M…
digitallysavvy Aug 21, 2026
526d2a1
Merge preview into mllm with Gemini and GPT Live routing
digitallysavvy Sep 14, 2026
56c1f27
Merge latest production main into mllm
digitallysavvy Sep 14, 2026
3914b9d
feat: unify Gemini preview MLLM models
digitallysavvy Sep 15, 2026
a66d0d5
fix: declare dynamic package version for uv
digitallysavvy Sep 15, 2026
115b7de
fix: guard optional preview headers in tests
digitallysavvy Sep 15, 2026
87557c0
Fix Gemini MLLM API key request shape
digitallysavvy Sep 15, 2026
ad4a83d
Use public Gemini 3.8 model IDs
digitallysavvy Sep 15, 2026
39a3edc
docs: document Gemini 3.8 MLLM public release
digitallysavvy Sep 15, 2026
197325b
feat: extend GeminiLive for Gemini 3.8 models
digitallysavvy Sep 15, 2026
1b936d4
docs: clarify GeminiLive model routing and defaults
digitallysavvy Sep 15, 2026
4f9fc0b
feat: add v3 stored-agent API and AgentKit deployment preview
digitallysavvy Oct 19, 2026
88fc0d7
feat: list assigned v3 numbers and document preview workflows
digitallysavvy Oct 19, 2026
6578f09
Fix v3 AgentKit realtime and managed preset mapping
digitallysavvy Oct 19, 2026
41f415c
Reject audio-only settings on text greetings
digitallysavvy Oct 19, 2026
5a6bf60
fix: preserve v3 interaction and provider ASR languages
digitallysavvy Oct 19, 2026
2b18bd7
fix: validate numeric choices and reload conflicts without write cond…
digitallysavvy Oct 19, 2026
3a29bb2
fix: declare stored agent variable state for type checking
digitallysavvy Oct 19, 2026
c9a5f09
docs: align Python SDK overview and references with final v3 preview
digitallysavvy Oct 19, 2026
0b4e502
Merge main into v3 preview preserving current production SDK features
digitallysavvy Oct 19, 2026
3755b48
feat: unify AgentKit save workflow and project provisioning
digitallysavvy Oct 19, 2026
984f8ba
feat: start saved and ephemeral agent sessions through common lifecycle
digitallysavvy Oct 19, 2026
06571c6
fix: preserve unrelated session stop failures
digitallysavvy Oct 19, 2026
a1a953a
fix: validate session region and align reference precedence
digitallysavvy Oct 19, 2026
50e7349
feat: align token transport sessions and campaigns with agreed contract
digitallysavvy Oct 27, 2026
b293816
docs: document public token workflow and all 31 operations
digitallysavvy Oct 27, 2026
f6d6cfe
feat: expose typed telephony transport for low-level session starts
digitallysavvy Oct 27, 2026
bcb5986
fix: preserve avatar credentials and reject credential-bearing origins
digitallysavvy Oct 27, 2026
ca74b7b
fix: sign token-backed legacy requests from app credentials
digitallysavvy Oct 27, 2026
2acc467
fix: complete RTC auth parity and unconditional conflict reloads
digitallysavvy Oct 27, 2026
057eb79
fix: preserve non-object session stop conflict errors
digitallysavvy Oct 27, 2026
5e758eb
fix: reject zero subscriber UIDs and note current preview rollout
digitallysavvy Oct 27, 2026
5e2d35f
fix: reject explicit blank session and campaign idempotency keys
digitallysavvy Oct 27, 2026
f747b40
fix: harden v3 session and transport edge cases
digitallysavvy Oct 27, 2026
52ea4f4
test: cover concurrent v3 session lifecycle reads
digitallysavvy Oct 27, 2026
2acbd2a
fix: validate effective token headers on raw clients
digitallysavvy Oct 27, 2026
b1aff34
fix: require effective token authorization on requests
digitallysavvy Oct 27, 2026
bdf40b5
fix: reject custom HTTP authentication handlers
digitallysavvy Oct 27, 2026
434843c
Revert "fix: reject custom HTTP authentication handlers"
digitallysavvy Oct 27, 2026
c06aa28
Align preview SDK with corrected shared release contract
digitallysavvy Oct 27, 2026
d776c69
Explicitly package preview contract snapshot and source handoff
digitallysavvy Oct 27, 2026
946fec6
Validate conditional provider credential constraints from contract
digitallysavvy Oct 27, 2026
642b860
Reject runtime endpoint aliases consistently across SDKs
digitallysavvy Oct 27, 2026
afec2f8
Keep runtime message updates independent of session transport
digitallysavvy Oct 27, 2026
c1d7ba4
Update documentation navigation for session PATCH operation
digitallysavvy Oct 27, 2026
8edae82
fix: limit preview pipelines to cascaded agents
digitallysavvy Oct 28, 2026
9df8284
docs: release v3.0.0-alpha.1 changelog
seymourtang Oct 28, 2026
e5f35ae
chore: align preview SDK versions and release configuration
seymourtang Oct 28, 2026
8bd0f37
merge: integrate production avatar updates into platform preview
digitallysavvy Oct 28, 2026
ebd5649
fix: align Platform builders and session helpers with documented flows
digitallysavvy Oct 28, 2026
9306af1
fix: capture Platform RTC signing identity for session handles
digitallysavvy Oct 28, 2026
0d438fc
fix: preserve raw Gemini credentials when normalizing Platform URLs
digitallysavvy Oct 28, 2026
bfafb6c
fix: refresh RTC tokens only for new successful-session lifecycles
digitallysavvy Oct 28, 2026
671bed3
fix: leave unsupported RTC token identities to server provisioning
digitallysavvy Oct 28, 2026
ed4466c
docs: align Azure and Bedrock required options with constructors
digitallysavvy Oct 28, 2026
e280c07
chore: prepare v3.0.0-alpha.2 release
seymourtang Oct 29, 2026
24cf4de
Merge latest production main into v3 preview
digitallysavvy Oct 29, 2026
78127a6
fix: validate ConvoAI tokens and preserve Platform provider settings
digitallysavvy Oct 29, 2026
e486cda
fix: reject whitespace in token signing credentials
digitallysavvy Oct 29, 2026
063d3ca
Prepare alpha.3 preview release metadata and installation docs
digitallysavvy Oct 29, 2026
83b48f5
Support Basic authentication alongside ConvoAI token007
digitallysavvy Oct 29, 2026
058627d
docs: finalize v3.0.0-alpha.3 changelog for 2026-10-30
seymourtang Oct 30, 2026
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
13 changes: 13 additions & 0 deletions .fernignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,16 @@ requirements.txt
.fern/replay.lock
.fern/replay.yml
.gitattributes

# Additive v3 preview adapter and typed staging contracts are maintained manually.
src/agora_agent/v3/

# Public token-only policy and transport enforcement are maintained manually.
src/agora_agent/client.py
src/agora_agent/core/public_auth.py
src/agora_agent/core/http_client.py
src/agora_agent/core/client_wrapper.py

# Shared corrected release contract, local preview generation input/handoff.
openapi.json
openapi.yaml
26 changes: 4 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,30 +102,12 @@ jobs:

- name: Verify package versions match release tag
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
ROOT_VERSION="$(poetry version -s | sed 's/^v//')"
COMPAT_VERSION="$(cd compat/agora-agent-server-sdk && poetry version -s | sed 's/^v//')"
COMPAT_DEP_VERSION="$(python -c "import re, sys; from pathlib import Path; text = Path('compat/agora-agent-server-sdk/pyproject.toml').read_text(); match = re.search(r'^agora-agents\s*=\s*\"([^\"]+)\"', text, re.M); sys.exit('agora-agents dependency not found in compat pyproject.toml') if not match else None; print(match.group(1))")"

if [ "$ROOT_VERSION" != "$TAG_VERSION" ]; then
echo "Root package version ($ROOT_VERSION) does not match tag version ($TAG_VERSION)."
exit 1
fi

if [ "$COMPAT_VERSION" != "$TAG_VERSION" ]; then
echo "Compat package version ($COMPAT_VERSION) does not match tag version ($TAG_VERSION)."
exit 1
fi

if [ "$COMPAT_DEP_VERSION" != ">=${TAG_VERSION},<3.0.0" ]; then
echo "Compat package dependency on agora-agents ($COMPAT_DEP_VERSION) does not match >=${TAG_VERSION},<3.0.0."
exit 1
fi
poetry run python scripts/check_release_workflow.py --tag "$GITHUB_REF_NAME"

- name: Publish primary package to pypi
run: |
PACKAGE_NAME="agora-agents"
PACKAGE_VERSION="${GITHUB_REF_NAME#v}"
PACKAGE_VERSION="$(poetry version -s | sed 's/^v//')"
STATUS="$(curl -sS -o /dev/null -w '%{http_code}' "https://pypi.org/pypi/${PACKAGE_NAME}/${PACKAGE_VERSION}/json")"
case "$STATUS" in
200)
Expand All @@ -146,7 +128,7 @@ jobs:

- name: Wait for primary package on PyPI
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
TAG_VERSION="$(poetry version -s | sed 's/^v//')"
PACKAGE="agora-agents"
for attempt in $(seq 1 12); do
if curl -fsS "https://pypi.org/pypi/${PACKAGE}/${TAG_VERSION}/json" >/dev/null; then
Expand All @@ -162,7 +144,7 @@ jobs:
- name: Publish compatibility package to pypi
run: |
PACKAGE_NAME="agora-agent-server-sdk"
PACKAGE_VERSION="${GITHUB_REF_NAME#v}"
PACKAGE_VERSION="$(poetry version -s | sed 's/^v//')"
STATUS="$(curl -sS -o /dev/null -w '%{http_code}' "https://pypi.org/pypi/${PACKAGE_NAME}/${PACKAGE_VERSION}/json")"
case "$STATUS" in
200)
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
TAG="${RELEASE_TAG}"
PRERELEASE=false
if [[ "$TAG" == *-* ]]; then PRERELEASE=true; fi
if gh release view "$TAG" >/dev/null 2>&1; then
gh release edit "$TAG" --title "$TAG" --notes-file release_notes.md
gh release edit "$TAG" --title "$TAG" --notes-file release_notes.md --prerelease="$PRERELEASE"
else
gh release create "$TAG" --title "$TAG" --notes-file release_notes.md
gh release create "$TAG" --title "$TAG" --notes-file release_notes.md --prerelease="$PRERELEASE"
fi
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,34 @@ The Agora Conversational AI SDK provides convenient access to the Agora Conversa
enabling you to build voice-powered AI agents with support for both cascading flows (ASR -> LLM -> TTS)
and multimodal flows (MLLM) for real-time audio processing.

## Run or save the same agent configuration

Use one `Agent` builder to configure providers, then call `create_ephemeral_session(...).start()` for an explicit Platform session or `create_session(...).start()` for a running session or `save()` for a `SavedAgent`. Async applications use `create_async_ephemeral_session()`, `create_async_session()` and `save_async()`. A saved handle owns `update(config)`, deletion, number assignment/unassignment, and client-side `list_numbers()` scans. Use `client.secrets` and `client.numbers` for provisioning, with explicit `secret_ref()` credentials for saved BYOK agents (inline keys remain valid for ephemeral sessions) and immutable `with_variable()` definitions for saved configurations.

Saving and project provisioning are part of SDK preview `3.0.0a3`. Existing session behavior is preserved. Saved agents and preview ephemeral sessions support cascaded ASR/LLM/TTS only; MLLM remains available for existing inline sessions. See the [daily agent workflow](docs/guides/agent-workflow.md), [persistence transport guide](docs/guides/v3-api-preview.md), and [advanced 32-operation reference](docs/reference/v3.md) for ETags, cursor pagination, session lifecycle, limited token/messages/provider-params updates, and project queries. The shared release contract is available as [openapi.yaml](openapi.yaml). `deploy` / `DeployedAgent` remain compatibility names. Saved handles also create sessions by ID; configurations with secret references or variable definitions start ephemeral sessions. Use `client.campaigns` for typed campaign create/list/get/update/delete/pause/resume/cancel operations. REST authentication supports `auth_token`, tokens signed from App ID/App Certificate, or Basic authentication through `customer_id` and `customer_secret`. Internal gateway headers remain unsupported. The new default origin is `https://preview.ai.agora.io`, with `/conversational-ai/v1/projects/{appid}`.

## Install

```sh
pip install agora-agents
pip install agora-agents==3.0.0a3
```

For source checkouts on Windows, use a short path and enable Git long paths before checkout:

```sh
git clone -c core.longpaths=true https://github.com/AgoraIO/agora-agents-python.git C:/src/agora-python
```

The generated legacy modules retain their public import names, including long filenames. A default Windows checkout in a deeply nested folder can still exceed OS/tool limits; installing the wheel avoids Git checkout limits.

## Requirements

- Python 3.8+

## Quick Start

Start with the `Agent` builder: create a client with app credentials, pass it to `Agent(client=client, ...)`, choose your ASR, LLM, and TTS providers, then start a session. Omit vendor API keys for supported Agora-managed global models, or provide keys when you want BYOK.
Set Agora interaction language with `turn_detection.language`; provider-specific STT language values remain under `asr.params`. Ares uses only the REST `asr.language` value sourced from `turn_detection.language`.
For Platform sessions, vendor STT language maps to `pipeline.asr.language`; explicit `turn_detection.language` overrides it. Ares defaults to `en-US`. Existing Voice Agent sessions retain their language mapping.

```python
import os
Expand Down Expand Up @@ -167,7 +181,7 @@ agent = Agent(client=client, turn_detection={"language": "en-US"}).with_stt(
)
```

Migrating from `agora-agent-server-sdk` on PyPI? Use `pip install agora-agents`; imports stay `agora_agent` — see [changelog migration notes](./changelog.md#migration-notes) or [installation guide](./docs/getting-started/installation.md#migrating-from-a-previous-package-name).
Migrating from `agora-agent-server-sdk` on PyPI? Use `pip install agora-agents==3.0.0a3`; imports stay `agora_agent` — see [changelog migration notes](./changelog.md#migration-notes) or [installation guide](./docs/getting-started/installation.md#migrating-from-a-previous-package-name).

## BYOK

Expand Down Expand Up @@ -207,6 +221,21 @@ session = agent.create_session(
session.start()
```

For Gemini 3.8 Live Extended Thinking, use the same single `GeminiLive` class as the regular Live model:

```python
from agora_agent import GeminiLive

gemini_agent = Agent(client=client).with_mllm(GeminiLive(
api_key=os.environ["GOOGLE_API_KEY"],
model="models/gemini-3.8-live-extended-thinking",
thinking_level="medium",
greeting_message="Hello! Ready to chat.",
))
```

Use `models/gemini-3.8-live` without `thinking_level` for the lower-latency model. Gemini sessions use the preview gateway and `agora-feature: gemini-live`; the Google key is sent as `mllm.api_key`. See the [Preview Endpoint guide](./docs/guides/preview-endpoint.md).

See the [MLLM Flow guide](./docs/guides/mllm-flow.md) for full examples with Gemini Live and Vertex AI.

## Documentation
Expand Down
28 changes: 28 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/).

## [v3.0.0-alpha.3] — 2026-10-30

- Support Basic REST authentication with `customer_id`/`customer_secret` alongside Token007 authentication in synchronous and asynchronous clients. Optional App Certificate signing remains available for RTC transport tokens.

- Include the ConvoAI service in SDK-generated authorization tokens by integrating the latest production token builder fix. Regression tests verify service grants, signatures and sync/async Platform session request headers.
- Preserve ASR provider language parameters for AssemblyAI, Google, Microsoft, Sarvam and Speechmatics, alongside the interaction language.
- Default Sarvam TTS to `bulbul:v3`, preserving explicit model overrides.
- Reject malformed App ID/certificate values, including whitespace.

## [v3.0.0-alpha.2] — 2026-10-29

- Correct Platform provider IDs, Gemini and Bedrock credentials, ASR language/keywords/endpoints, and HeyGen mapping. Managed OpenAI model availability is validated by the service.
- Add explicit ephemeral-session and outbound-call helpers, full inbound call policies, RTC token generation for fixed numeric UIDs, Azure resource names, optional session analysis and secret-key metadata.
- Fix Pydantic import configuration warnings and document Windows source checkout requirements.
- Preserve Gemini credentials during endpoint normalization and capture RTC signing identity per session. Retain generated RTC tokens across failed-start retries, refresh them for new unkeyed session lifecycles, and leave unsupported UIDs to server provisioning.

## [v3.0.0-alpha.1] — 2026-10-28

- Shared root OpenAPI JSON/YAML, local reproducible wire generator, sync/async/raw session PATCH, and cascaded-only preview contracts.
- Realtime/MLLM configurations and runtime updates are rejected by preview APIs before network access; existing inline MLLM sessions remain supported.
- BYOK `credential.fields` preserves vendor credential names; saved writes require explicit secret references, ephemeral sessions permit inline values.
- Optional RTC UID, inbound/voicemail end-call policies, SIP IPv4 allowlists, campaign create retention, 50,000-contact / 10 MiB limits. Removed campaign retry fields are rejected.
- Six idempotent POST operations use optional 1–256 visible ASCII keys, 24-hour replay and replay response headers. No automatic write retries or region availability gates.

### Preview rollout

The current stored-agent, session and campaign preview rollout is available in the US only (PM confirmation, 2026-10-27). Availability may expand as rollout progresses.

## [v2.13.0] — 2026-10-29

### Added
Expand Down
4 changes: 3 additions & 1 deletion compat/agora-agent-server-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This package has been renamed to `agora-agents`.
New projects should install:

```sh
pip install agora-agents
pip install agora-agents==3.0.0a3
```

This compatibility package re-exports the public API from `agora-agents` to support existing installs during the migration window. The primary import path remains `agora_agent`; you can also import from `agora_agent_server_sdk_compat`:
Expand All @@ -16,3 +16,5 @@ from agora_agent_server_sdk_compat import Agora, Area
```

Maintainers: dual-publish steps live in the repository release workflow, not in the root README.

The shim exposes features from the installed `agora-agents` version; it does not independently add API support. The [v3 stored-agent preview](../../docs/guides/v3-api-preview.md) is included in preview `3.0.0a3`. Existing v2 imports remain available.
4 changes: 2 additions & 2 deletions compat/agora-agent-server-sdk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "agora-agent-server-sdk"

[tool.poetry]
name = "agora-agent-server-sdk"
version = "v2.13.0"
version = "3.0.0a3"
description = "Compatibility shim for the renamed agora-agents package."
readme = "README.md"
authors = []
Expand Down Expand Up @@ -35,7 +35,7 @@ Repository = 'https://github.com/AgoraIO/agora-agents-python'

[tool.poetry.dependencies]
python = "^3.8"
agora-agents = ">=2.13.0,<3.0.0"
agora-agents = ">=3.0.0a3,<4.0.0"

[build-system]
requires = ["poetry-core"]
Expand Down
2 changes: 2 additions & 0 deletions docs/concepts/agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ description: The Agent builder — configure an AI agent with LLM, TTS, STT, and

The `Agent` class is a fluent builder for configuring AI agent properties. Pass a bound `Agora` or `AsyncAgora` client with `client=...` — it is required for `create_session()` and `create_async_session()`. The builder collects vendor settings (LLM, TTS, STT, MLLM, avatar) and produces a fully configured `AgentSession` when you call `create_session()`. The agent instance name is set on `create_session(name=...)`, not on the `Agent` constructor.

In the [v3 preview](../guides/v3-api-preview.md), the same local builder can save a stored configuration with `save()` / `save_async()`. Its stored name is passed to deploy, and the returned handle manages inbound-number assignments. This does not start a session or change the v2 `create_session()` lifecycle. Secret references require deployment; they cannot be sent to v2 sessions.

## Constructor

<!-- snippet: executable -->
Expand Down
7 changes: 6 additions & 1 deletion docs/concepts/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ This is the primary developer-facing API. It provides:

### Fern-Generated Layer

The auto-generated core provides typed HTTP methods for every Agora API endpoint. You rarely need this directly, but it is accessible via `session.raw` for advanced use cases or new endpoints that the agentkit layer does not yet cover.
The auto-generated core provides typed HTTP methods for the existing v2 API endpoints. You rarely need this directly, but it is accessible via `session.raw` for advanced use cases or new endpoints that the agentkit layer does not yet cover.

### v3 Preview Adapter

`client.v3` adds typed wire dictionaries and agents/secrets/numbers/session-read resources alongside the v2 generated clients. It reuses the pool client's HTTP transport and authentication, with separate staging origin/header overrides. This is protected custom/local-generated code rather than canonical Fern output. AgentKit adds `SavedAgent` / `AsyncSavedAgent` for persisted configurations; existing session handles remain v2. See [v3 workflows](../guides/v3-api-preview.md) and [reference](../reference/v3.md).

## Sync vs. Async

Expand All @@ -51,6 +55,7 @@ The SDK provides two parallel client hierarchies:
|---|---|---|
| `Agora` | `AsyncAgora` | `httpx.Client` / `httpx.AsyncClient` |
| `AgentSession` | `AsyncAgentSession` | Blocking calls / Coroutines |
| `SavedAgent` (preview) | `AsyncSavedAgent` (preview) | Stored configuration and number assignment calls |

### When to Use Each

Expand Down
33 changes: 19 additions & 14 deletions docs/getting-started/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Configure the Python SDK with app credentials and understand other

# Authentication

Create `Agora` or `AsyncAgora` with `app_id` and `app_certificate` only. The SDK mints a fresh ConvoAI REST token for each API call and generates the RTC join token when the session starts.
By default, create `Agora` or `AsyncAgora` with `app_id` and `app_certificate`. The SDK mints a fresh ConvoAI REST token for each API call and generates the RTC join token when the session starts.

## App credentials

Expand Down Expand Up @@ -50,35 +50,40 @@ session = agent.create_session(
print(client.auth_mode) # "app-credentials"
```

## Legacy auth modes
## Pre-built REST tokens

The generated client still supports pre-minted REST tokens and HTTP Basic Auth for legacy integrations. Do not use those modes for new session integrations. Use app credentials so AgentKit can mint short-lived ConvoAI REST auth and RTC join tokens for each session.
The SDK supports Token007 and Basic REST authentication. Pass a raw `auth_token`, let the SDK sign tokens from `app_id` and `app_certificate`, or configure a Customer ID/Secret pair. REST authentication is separate from the optional RTC transport token.

### HTTP Basic Auth
### Pre-built REST token

Pass the raw token string. The SDK sets `Authorization: agora token=<auth_token>` automatically.

```python
client = Agora(
area=Area.US,
app_id="your-app-id",
app_certificate="your-app-certificate",
customer_id="your-customer-id",
customer_secret="your-customer-secret",
auth_token="your-raw-token", # No certificate needed for prebuilt REST auth.
)
print(client.auth_mode) # "basic"
print(client.auth_mode) # "token"
```

### Pre-built REST token
New resources use `https://preview.ai.agora.io/conversational-ai/v1/projects/{appid}`. Do not send internal gateway headers or `X-Studio-Region`.

Pass the raw token string. The SDK sets `Authorization: agora token=<auth_token>` automatically.
A client with only a REST `auth_token` or Basic credentials cannot generate RTC join tokens. Supply `token=` when starting an ordinary legacy RTC session, or also configure the App Certificate for RTC signing. Saved/ephemeral RTC sessions accept their optional token through `transport.token`.

## Basic REST authentication

```python
client = Agora(
area=Area.US,
app_id="your-app-id",
app_certificate="your-app-certificate",
auth_token="your-raw-token",
customer_id="your-customer-id",
customer_secret="your-customer-secret",
# app_certificate="your-app-certificate", # Optional RTC token signing.
)
print(client.auth_mode) # "token"
print(client.auth_mode) # "basic"
```

`auth_token` is mutually exclusive with `customer_id` / `customer_secret`.
The same options work with `AsyncAgora`. Both credentials must be nonempty, and Customer ID must not contain a colon. Do not combine them with `auth_token`. The SDK sends `Authorization: Basic <base64(customer_id:customer_secret)>` on REST requests, including saved-agent and ephemeral sessions. An optional App Certificate signs RTC tokens without replacing Basic REST authentication.

For low-level overrides, a valid Basic `Authorization` header is accepted in request options. Configure credentials on the SDK client instead of attaching `httpx.BasicAuth` to the underlying HTTP client, which would silently override SDK authentication.
6 changes: 3 additions & 3 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ description: Install the Agora Conversational AI Python SDK.
## Install with pip

```sh
pip install agora-agents
pip install agora-agents==3.0.0a3
```

## Install with Poetry

```sh
poetry add agora-agents
poetry add agora-agents@3.0.0a3
```

## Imports
Expand Down Expand Up @@ -59,7 +59,7 @@ from agora_agent import AsyncAgora, AsyncAgentSession, Area
| Package | Purpose |
| ------------------------------ | ------------------------------------------------------ |
| `httpx` (>= 0.21.2) | HTTP client for sync and async requests |
| `pydantic` (>= 1.9.2) | Data validation for vendor configuration and API types |
| `pydantic` (>= 2.7.1, < 3) | Data validation for vendor configuration and API types |
| `typing_extensions` (>= 4.0.0) | Backported type hints for Python 3.8+ |

## Next steps
Expand Down
Loading
Loading