# API

Use the codemix HTTP API with an API key, or open the full interactive reference at /swagger.

The codemix API is a normal HTTP API for scripts, internal tools and integrations.

This page is the quick version. The complete interactive reference is at [Swagger](/content/swagger/index.html).

## Base URL

Use the production API at:

```text
https://codemix.com
```

Most endpoints live under:

```text
/api/v1
```

Open [Swagger](/content/swagger/index.html) for the exact paths, methods, request bodies and response shapes.

## Authentication

Create an API key in [Settings > API Keys](/content/settings/api-keys/index.html).

Send it as a bearer token:

```bash
curl https://codemix.com/api/v1/me \
  -H "Authorization: Bearer $CODEMIX_API_KEY"
```

Keep keys out of source control and shared prompts. Use environment variables in local scripts and CI.

## Typical use

Use the API when you want to:

1. query codemix from internal tools
2. connect codemix to CI or automation
3. inspect account, organization, project or task data
4. build a workflow that should not depend on the web UI

For terminal-first work, the [CLI](/content/docs/cli/index.html) is usually faster. For AI clients, the [MCP server](/content/docs/mcp-server/index.html) is usually the better interface.

## Errors

Common responses:

1. `401`: missing or invalid API key
2. `403`: the key does not have access to that organization or project
3. `404`: the resource does not exist in the selected scope
4. `429`: the request was rate limited

Check [Swagger](/content/swagger/index.html) for endpoint-specific status codes.

## Full reference

Use [Swagger](/content/swagger/index.html) for the full API docs.

It includes the current OpenAPI schema, endpoint list, parameter details and response examples. That is the source of truth for request shape.
