Quickstart

Get a key, point any OpenAI SDK at the CompanyFabric base URL, and make your first metered call.

1. Get an API key

Create a free account and copy your key from the dashboard, it is shown once, so store it as an environment variable. Free starter credits are included; no card is required to try the API.

export COMPANYFABRIC_API_KEY="sk-cf-…"

2. Make your first call

The API is OpenAI-compatible: any OpenAI SDK works by changing the base URL and key. One key covers every model in the library.

curl https://api.companyfabric.com/v1/chat/completions \
  -H "Authorization: Bearer $COMPANYFABRIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "companyfabric/auto",
    "messages": [{ "role": "user", "content": "Say hello." }]
  }'

3. Read the exact cost

Every response carries exact metered usage. usage.cost_usd is what the request charged your balance, provider tax and platform fee included: the same number the dashboard and your invoice show. On a streamed response the chunk that carries usage carries cost_usd too; ask for it with stream_options: { include_usage: true }, as with OpenAI.

Next steps

  • Pick a model from the library (/models) or stay on companyfabric/auto.
  • Set a budget cap on your key in the dashboard so a runaway loop stops at the cap.
  • Generating video, image, or audio? Use the async jobs API (/docs/jobs).
  • Routing, triage, moderation, or a go/no-go before an expensive step? Ask a decision model on /v1/decisions (/docs/decisions): probabilities in about 100 ms, no text to parse.