Skip to content

Align with modernized TS SDK: hosted-gateway default, OTARI_AI_TOKEN, logo#1

Open
khaledosman wants to merge 2 commits into
mainfrom
docs/clarify-api-token-and-logo
Open

Align with modernized TS SDK: hosted-gateway default, OTARI_AI_TOKEN, logo#1
khaledosman wants to merge 2 commits into
mainfrom
docs/clarify-api-token-and-logo

Conversation

@khaledosman
Copy link
Copy Markdown

@khaledosman khaledosman commented May 29, 2026

Brings the Python SDK in line with the modernized TypeScript SDK (otari-sdk-ts#8 + #9), so the SDKs behave and read consistently.

Behavioral changes

  • Hosted-gateway default: in platform mode, api_base now defaults to https://api.otari.ai when none is supplied — so OtariClient(platform_token="tk_...") works with no further setup. API-key (self-hosted) mode still requires an explicit base URL.
  • Canonical env var: read OTARI_AI_TOKEN for the platform token, keeping GATEWAY_PLATFORM_TOKEN as a legacy alias (canonical wins when both are set). Base/key env vars remain GATEWAY_API_BASE / GATEWAY_API_KEY, matching the TS SDK.

Docs

  • Logo: add the otari seal + wordmark (assets/otari-logo.svg) to the README header.
  • Hosted-first README: Quickstart now leads with the hosted path; added a "Self-hosting the gateway" section and updated the credentials/auth-mode sections for OTARI_AI_TOKEN and the hosted default.
  • Token setup: link to where you generate an API token and add a provider key on the hosted platform.
  • Error table: a 404 can mean no provider key is configured for the requested provider, and the exception's message carries the gateway's detail.

Implementation note

No error-handling change was needed — the gateway's {"detail": "..."} body already reaches the typed exception message (the OpenAI Python SDK embeds the body in APIStatusError.message; the batch path extracts detail directly). The fetch-wrapper fix in the TS PR was specific to the JS OpenAI SDK, which drops the body as "(no body)".

Verification

  • pytest tests/ → all green (incl. 6 new hosted-default / env-precedence tests)

  • ruff check src/ tests/ → clean

  • mypy src/ → clean

  • Verified end-to-end: a sample app completed a real request against the live hosted gateway (https://api.otari.ai) using the hosted default.

🤖 Generated with Claude Code

khaledosman and others added 2 commits May 29, 2026 15:17
Mirrors the otari-sdk-ts changes for consistency across SDKs:
- Add the otari logo (seal + wordmark) to the README header
- Note where to generate an API token and add a provider key on the
  hosted platform in the Platform Mode section
- Clarify that a 404 can mean no provider key is configured, and that
  the exception message carries the gateway's detail

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Brings the Python SDK to parity with the modernized otari-sdk-ts:
- In platform mode, default api_base to https://api.otari.ai when none is
  given, so OtariClient(platform_token=...) works with no further setup.
  API-key (self-hosted) mode still requires an explicit base URL.
- Read the canonical OTARI_AI_TOKEN env var for the platform token, keeping
  GATEWAY_PLATFORM_TOKEN as a legacy alias (canonical wins).
- Rewrite the README to be hosted-first.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@khaledosman khaledosman changed the title docs: add otari logo; clarify API token and provider key setup Align with modernized TS SDK: hosted-gateway default, OTARI_AI_TOKEN, logo May 29, 2026
@khaledosman khaledosman requested a review from tbille May 29, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant