curl. For authentication and HTTP semantics, see Introduction.
Prefer not to write code? Your AI coding agent can do all of this for you — connect it to
Chief and just ask. See Use Chief with your AI coding agent. This page is the
manual, do-it-yourself path.
Prerequisites
- A Chief account with access to a project
- A PAT from Settings → API tokens — the help center walks through creating one
- Your project id (
project_…)
Start a chat
POST /v1/chats starts an async workflow and returns ids immediately:
202 Accepted):
Poll for the response
Poll untilresponse appears on the message:
Continue the conversation
What you just built
That’s the whole loop: your code asked a question, Chief answered it from your project’s knowledge, and you continued the thread — with no retrieval pipeline or infrastructure to run. That same primitive is the foundation for a Q&A feature in your app, a scheduled digest, an agent that reads your project, and more. See What you can build for where to take it.FAQ
Where do I get an API key?
Where do I get an API key?
Create a Personal Access Token in the Chief app under Settings → API tokens. The full secret is shown only once, at creation.
Why did POST /v1/chats return 202 instead of an answer?
Why did POST /v1/chats return 202 instead of an answer?
Chat endpoints are asynchronous. The
202 carries the ids; poll GET /v1/chats/{id}/messages/{mid} until the response field appears.How long should I wait between polls?
How long should I wait between polls?
Use exponential backoff and cap total wait time in production. There is no lifecycle enum to watch — the arrival of
response means the turn is done.Do I need to write code at all?
Do I need to write code at all?
No. Connect an AI coding agent over MCP and ask in plain English — see Use Chief with your AI coding agent. The
chief CLI covers shell and CI without code too.I got a 400 mentioning the project header.
I got a 400 mentioning the project header.
Every project-scoped endpoint needs
X-Project-Id alongside X-API-Key. A missing or malformed value returns publicapi.tenancy.project.missing.Next steps
- What you can build — concrete outcomes built on this loop
- Chats guide — scope, intelligence modes, and listing
- Assets guide — upload files for use in
scope - Tools — skip curl with the Go SDK, the
chiefCLI, or the MCP server - API reference → Chats → Start a chat — full request schema