跳转至

CodeBair Quick Start in 30 Seconds

This page is for first-time CodeBair users.

中文 Client Integration Guide

1. Shared Parameters

  • Base URL: https://api.codebair.com/v1
  • API Key: your CodeBair key (sk-...)
  • Model: any model you are allowed to use from /v1/models

Security tip: never paste your API key into public repos, chat groups, or screenshots.

2. Fastest Path

  1. Get your CodeBair API key
  2. Find OpenAI API Key, Custom API, or OpenAI-compatible settings in your client
  3. Fill in the Base URL, API key, and model
  4. Run one minimal request to verify it works

3. Minimal Test Request

PowerShell

curl.exe https://api.codebair.com/v1/chat/completions `
  -H "Content-Type: application/json" `
  -H "Authorization: Bearer YOUR_CODEBAIR_API_KEY" `
  -d '{"model":"YOUR_AVAILABLE_MODEL","messages":[{"role":"user","content":"ping"}]}'

macOS / Linux

curl https://api.codebair.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_CODEBAIR_API_KEY" \
  -d '{"model":"YOUR_AVAILABLE_MODEL","messages":[{"role":"user","content":"ping"}]}'

4. Pick Your Client

Tool Go to
Claude Code Claude Code
CC Switch CC Switch
Codex Codex
Cursor Cursor
Cherry Studio Cherry Studio
Kilo Kilo
OpenCode OpenCode
OpenClaw OpenClaw
Chatbox Chatbox
WorkBuddy WorkBuddy
Gemini CLI Gemini CLI

5. Most Common Errors

  • 401: wrong key, extra spaces, or not a CodeBair key
  • 403: insufficient permission, no balance, or account restriction
  • 404: wrong Base URL, often missing /v1
  • Model not found: invalid model name, use a model from /v1/models

6. What Success Looks Like

  • HTTP status is 200
  • JSON response contains choices
  • choices[0].message.content contains model output