> For the complete documentation index, see [llms.txt](https://sonic-ai-works.gitbook.io/sonic-networks-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sonic-ai-works.gitbook.io/sonic-networks-docs/api-reference/sonic-ai-control-plane-api.md).

# Sonic AI Control Plane API

Model registry, task routing, usage and admin APIs for Sonic AI v1.0 Pro.

Base URL: `/api/v1`

## Creator-facing routes

```
GET  /ai/models
GET  /ai/models/:id
GET  /ai/providers
GET  /ai/routing
PUT  /ai/routing
POST /ai/chat
POST /ai/complete
POST /ai/music/brief
POST /ai/lyrics
POST /ai/projects/:id/analyze
GET  /ai/operations/:id
GET  /ai/usage
```

The API exposes the SONIC profile and safe routing metadata. It never returns provider secrets.

`POST /ai/complete` accepts a SONIC task, prompt, optional mode, project ID and safe context. The server resolves the actual route using capability, privacy, health, cost, latency, environment and policy.

## Admin routes

```
GET   /admin/ai/models
PATCH /admin/ai/models/:id
GET   /admin/ai/providers
GET   /admin/ai/health
PUT   /admin/ai/routing/:task
```

Admin writes are role-authorized, audited and routing policy publication is idempotent/versioned.

## Usage

Usage records identify the transport/provider/model that actually executed and include routing reason, latency, available token counts, credit fields and terminal status.

## Security

`AI_GATEWAY_API_KEY`, direct-provider credentials and Ollama/private endpoints are server configuration. A configured credential does not automatically make a model user-visible; the model definition and feature/routing policy must also enable it.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sonic-ai-works.gitbook.io/sonic-networks-docs/api-reference/sonic-ai-control-plane-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
