Keep your existing SDK
Configure the base URL, Cloudsome API key and an available model ID on supported OpenAI-compatible endpoints.
Integration guide →Cloudsome provides unified access to the world's leading AI models through a single, developer-friendly API.
client = OpenAI(base_url="https://api.cloudsome.ai/v1", api_key=os.environ["CLOUDSOME_API_KEY"])Three layers: your stack on top, the CLOUDSOME gateway in the middle, and the available upstream providers below.
https://api.cloudsome.ai/v1Configure the base URL, Cloudsome API key and an available model ID on supported OpenAI-compatible endpoints.
Integration guide →Eligible failures can retry on an available fallback route. A response that has already started streaming can still be interrupted.
Integration guide →No subscription. Text, images and video are billed in their documented units, based on actual usage.
Integration guide →Eligible failures can retry on an available fallback route. A response that has already started streaming can still be interrupted.
Illustrative preview · not live usage data
Reusable policies for budgets, models and providers. Bind them to API keys or organization members.
Illustrative preview · not live usage data
Model, usage, status and timing support billing and analytics. Account and billing records are retained.
Asynchronous tasks and necessary security or operational logs may retain request or result data. Upstream providers apply their own policies.
Follow each tool's setup guide for the endpoint, API key and supported model.
ANTHROPIC_BASE_URLIntegration guide →CDXconfig.tomlIntegration guide →OCopencode.jsonIntegration guide →⇄cc-switchIntegration guide →POST /v1/chat/completionsPOST /v1/responsesPOST /v1/embeddingsPOST /v1/images/generationsGET /v1/modelsSet the base URL and use an available model ID from the Models page.
Create an account, top up your balance and generate an API key.
Set CLOUDSOME_API_KEY on your server and choose a model from the catalog.
Install the OpenAI SDK or use cURL, then send your first request.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.cloudsome.ai/v1",
api_key=os.environ["CLOUDSOME_API_KEY"],
)
response = client.chat.completions.create(
model="YOUR_MODEL_ID",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)No subscription. Pay for actual usage.
An estimated amount is reserved from your balance before the upstream request.
The provider processes the request and reports usage.
Settle actual usage and release the unused reservation. See billing rules for failed and interrupted requests.
cost = (input_tokens × input_price + output_tokens × output_price) / 1MBilling →Text pricing example; other modalities use their own billing units.
Cloudsome is an AI API gateway that provides multiple AI models through a unified API key and OpenAI-compatible interfaces. See the Models page and API documentation for currently available models and their supported endpoints.
If a request fails before the response begins because of validation, rate limiting, insufficient balance, or an upstream error, you are not charged and the pre-deducted amount is fully refunded. Errors after the response begins are billed for usage already generated. See our Billing Rules page for details.
Cloudsome supports common OpenAI SDK workflows for the endpoints listed in our documentation. With the official OpenAI Python or Node.js SDK, you can usually get started by changing the base URL and API key. Check the API documentation for support in other tools.
Reusable policies for budgets, models and providers. Bind them to API keys or organization members.
Create an account, add funds and connect your first model.