API Code
Connection settings
- Provider: OpenAI Compatible / Custom OpenAI provider
- API-credit base URL:
https://api.yourdomain.example/v1 - API-token base URL:
https://api.yourdomain.example/token/v1 - API key: your full CloudService key
- Model: an exact ID returned by the authenticated
/modelsendpoint (for example,fable-5for a Claude-capable or both-scope key)
Use the URL that belongs to the key. API-credit and API-token keys deliberately return an authentication failure on the other billing surface. The examples below use CLOUDSERVICE_BASE_URL so the same code works for either key type.
Fable 5 is an Anthropic-family frontend model. It can use this normalized Chat Completions shape, but never appears for an OpenAI-only key. A Claude token key can use the same request shape on https://api.yourdomain.example/token/v1, selecting only an ID returned for that key. Native Anthropic clients use the origin-only token URL https://api.yourdomain.example/token; use the Claude Code guide or Claude Desktop guide.
Models
fable-5gpt-5.6-lunagpt-5.6-solgpt-5.6-terragpt-5.5gpt-5.4gpt-5.4-minigpt-5.3-codexcodex-auto-review
Node example
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.CLOUDSERVICE_API_KEY,
baseURL: process.env.CLOUDSERVICE_BASE_URL
});Automatic setup
npm install -g cloudservice@latest
cloudserviceThe CLI writes examples with the base URL detected from the key. For apps that only expose UI settings, it writes a setup guide under ~/.cloudservice/.