Skip to main content
You can use the official OpenAI and Anthropic SDKs for Python or TypeScript with one Capriole AI API key. Configure the OpenAI client with the /v1 base URL and the Anthropic client with the API root, then call the protocol-native endpoint each SDK expects. Personal Premium costs USD 8 per month and includes 5 million charged API tokens plus unlimited browser chat across the supported Premium model set. The same membership can power an application through these SDKs, a coding agent through a maintained integration, and everyday work in the browser. This guide builds the same two-request check in both languages. Each example sends an OpenAI Responses request and an Anthropic Messages request.

Choose the request path

Use Responses for Responses-native OpenAI applications. Use Chat Completions when an existing OpenAI-compatible application expects that contract. Use Messages for Claude-native code.

Before you start

You need active Premium or eligible Team access, a Capriole AI API key, and either Python or Node.js 20 or later. Copy a newly created key when Capriole shows it; the full secret is not shown again.
1

Create an environment and install both SDKs

Create and activate a virtual environment on macOS or Linux, then install the official packages:
On Windows PowerShell, activate the same environment with:
Keep the environment active for the remaining steps. The install command should finish with both packages available and no dependency error.
2

Set the Capriole API key

The program below reads the key from the environment. It does not place the secret in source code.
3

Create the SDK example

Save this file as capriole_sdk_example.py:
auth_token is intentional. It makes the Anthropic SDK send the Capriole API key as a Bearer token.
4

Run the program

A successful run prints two non-empty model responses, usually the requested markers:
Models do not always follow exact-output prompts. If the wording differs, two non-empty responses still confirm that both SDK paths returned model output.

Run the same check with TypeScript

Use Node.js 20 or later. Install the official SDKs and a TypeScript runner in a new project:
Set the same API key in the shell that will run the program:
Save the following file as capriole-sdk-example.ts:
Run it with:
You should receive two non-empty responses. The TypeScript constructors use baseURL, while the Python constructors use base_url. The Anthropic examples use authToken or auth_token so the SDK sends Bearer authentication to Capriole.

Use Chat Completions when your app expects it

The same OpenAI client can call the Chat Completions-compatible endpoint:
Do not move google-latest to responses.create(). The Responses route accepts the supported OpenAI Responses model set, while Chat Completions accepts the broader public compatible catalog.

Fix common SDK errors

Understand the result boundary

Capriole preserves the protocol requested by the SDK. Responses output remains Responses output, and Anthropic Messages output remains Messages output. One account and balance sit behind both routes; the response schemas do not become interchangeable. The multi-protocol API article explains that architecture. Use the Responses reference, Chat Completions reference, or Messages reference for endpoint fields. The API quickstart remains the shortest route to a raw first request. Read how Capriole tests multi-model API compatibility for the evidence required before a protocol, alias, or client path is documented as supported. API calls are metered in charged tokens. Read how charged tokens are calculated before estimating a workload.

Official SDK references

Try GPT-5.6 Thinking, Claude Fable 5, or Gemini 3.1 Pro in limited free browser chat, then upgrade to Premium when you want to use the included API balance from Python or TypeScript. Facts checked: 2026-08-11.
Last modified on August 18, 2026