Skip to content

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 /models endpoint (for example, fable-5 for 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-5
  • gpt-5.6-luna
  • gpt-5.6-sol
  • gpt-5.6-terra
  • gpt-5.5
  • gpt-5.4
  • gpt-5.4-mini
  • gpt-5.3-codex
  • codex-auto-review

Node example

ts
import OpenAI from 'openai';
const client = new OpenAI({
  apiKey: process.env.CLOUDSERVICE_API_KEY,
  baseURL: process.env.CLOUDSERVICE_BASE_URL
});

Automatic setup

bash
npm install -g cloudservice@latest
cloudservice

The 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/.