Quickstart
Crafted AI is a drop-in gateway for OpenAI-compatible chat completions. Point
the OpenAI SDK at our base URL, swap the API key for a cai_… gateway key,
and you get unified usage tracking, BYOK provider keys, and per-key rate
limits — without touching the rest of your code.
1. Create an account
Section titled “1. Create an account”Sign up at app.craftedai.co. A personal organisation is provisioned for you on first login.
2. Add a provider credential (BYOK)
Section titled “2. Add a provider credential (BYOK)”Open Credentials → Provider keys in the control panel and paste an OpenAI
or Anthropic API key. Provider keys are encrypted at rest with the gateway’s
MODEL_CONFIG_ENCRYPTION_KEY and are never returned by the API after they
are stored.
3. Mint a gateway key
Section titled “3. Mint a gateway key”Open Credentials → Gateway keys → New key. Copy the cai_… value — it is
shown exactly once. Optionally set a requests-per-minute (RPM) cap and a
daily token cap for the key. Treat the value like any other secret.
4. Configure your client
Section titled “4. Configure your client”Set two environment variables:
export CRAFTED_AI_KEY="cai_..."export CRAFTED_AI_BASE_URL="https://api-staging.craftedai.co/v1"5. Send your first request
Section titled “5. Send your first request”curl "$CRAFTED_AI_BASE_URL/chat/completions" \ -H "Authorization: Bearer $CRAFTED_AI_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o-mini", "messages": [ { "role": "user", "content": "Say hello in one short sentence." } ] }'import OpenAI from 'openai';
const client = new OpenAI({ apiKey: process.env.CRAFTED_AI_KEY, baseURL: process.env.CRAFTED_AI_BASE_URL,});
const res = await client.chat.completions.create({ model: 'gpt-4o-mini', messages: [{ role: 'user', content: 'Say hello in one short sentence.' }],});
console.log(res.choices[0]?.message?.content);import osfrom openai import OpenAI
client = OpenAI( api_key=os.environ["CRAFTED_AI_KEY"], base_url=os.environ["CRAFTED_AI_BASE_URL"],)
res = client.chat.completions.create( model="gpt-4o-mini", messages=[{"role": "user", "content": "Say hello in one short sentence."}],)
print(res.choices[0].message.content)6. Inspect usage
Section titled “6. Inspect usage”Open app.craftedai.co/usage to see the call appear with token counts and cost, broken down by gateway key and model.
7. Install your first pack
Section titled “7. Install your first pack”Open the Marketplace, install General SMB, and resend the same request from step 5. You now have a working Bot. The request looks identical to what you sent before — same model, same messages — but the gateway now prepends a system prompt, injects scheduling and support tools, and applies skill instructions automatically. No code change.
This is the Bot platform in one action: install a pack, bind the resulting bot to your gateway key, and every subsequent request through that key gets the full configuration applied.
Read Concepts to understand the four entities — Bots, Skills, MCPs, and Industry Packs — and how they compose at request time.
What you get for free
Section titled “What you get for free”- Drop-in OpenAI compatibility — works with the official OpenAI SDKs and any OpenAI-compatible client.
- Anthropic translation — request a Claude model and the gateway adapts the request and response on the fly.
- Usage tracking — every call is recorded with prompt/completion tokens, cost, and latency, scoped to your organisation, gateway key, and model.
- Streaming — set
stream: trueand the gateway forwards Server-Sent Events withstream_options.include_usagealready injected so the final chunk carries token counts. - Bot platform — bind a Bot to your gateway key and every request gets the bot’s system prompt, skills, and plugins applied automatically.
- WhatsApp — configure a Twilio sender and bind a Bot so inbound WhatsApp messages get the same bot treatment as gateway API calls.
Next: read the Gateway API reference for the full request and error envelope, configure WhatsApp, connect MCP integrations, or jump to Credentials for rotation and rate-limit guidance.