Testing your first API request

Verify your key and make a real chat call from the command line.

1. Verify the key

Confirm the key is valid and see what it resolves to:

bash
curl -X POST https://api.carrieros.ai/v1/auth/verify \
  -H "Authorization: Bearer carrier_sk_live_YOUR_KEY"

2. List the modes

bash
curl https://api.carrieros.ai/v1/models \
  -H "Authorization: Bearer carrier_sk_live_YOUR_KEY"

3. Send a chat message

bash
curl -X POST https://api.carrieros.ai/v1/chat \
  -H "Authorization: Bearer carrier_sk_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "mode": "general", "message": "Hello, Carrier OS!" }'

4. Continue the conversation

Reuse the session_id from the previous response to keep context:

bash
curl -X POST https://api.carrieros.ai/v1/chat \
  -H "Authorization: Bearer carrier_sk_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "mode": "general", "message": "Summarize that in one line.", "session_id": "PASTE_SESSION_ID" }'

What to check

  • Every response has a top-level success boolean.
  • An invalid or revoked key returns 401.
  • Calls only ever see data from this key's project.
Prefer a GUI? Import the same requests into Postman, or use the VS Code REST Client — the flow is identical.