> 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-orchestration-contracts.md).

# Sonic AI orchestration contracts

Sonic AI v1.0 Pro control-plane contracts for routing, context, providers, tools, artifacts and usage accounting.

`Sonic AI v1.0 Pro` is a product-facing orchestration profile. The API should expose stable SONIC concepts while keeping provider-specific model IDs and credentials behind a server-side registry.

## Normalized request

A normalized AI request carries tenant/account context, task intent, required capabilities, context policy, routing policy and optional project/resource identifiers.

## Routing

The router filters configured models by capability, policy, privacy and health, then chooses a route using quality/latency/cost telemetry.

Provider families may include OpenAI, Anthropic, DeepSeek, Ollama/local inference and additional configured adapters.

## Context

Context blocks identify source type, source ID, priority and provenance. Retrieval is permission-filtered and task-scoped. Private workspace content must not be injected merely because a model supports a larger context window.

## Tools

Each AI tool declares:

```
id
domain
requiredPermissions
mutating
requiresConfirmation
```

Tool execution re-checks authorization at execution time.

## Artifacts

AI-generated drafts can be stored as typed artifacts with `draft`, `approved`, `applied` or `rejected` status and provenance to the originating operation.

## Usage

Normalized usage records can retain Sonic profile, provider/model ID, input/output units where applicable, AI Credits reserved/settled, latency and terminal status.

## Suggested endpoint family

The following endpoint family is an architectural contract and must be marked **planned** until implemented in released source:

```
POST /api/v1/ai/chat
POST /api/v1/ai/complete
GET  /api/v1/ai/models
GET  /api/v1/ai/providers
POST /api/v1/ai/projects/:id/analyze
POST /api/v1/ai/prompts/enhance
GET  /api/v1/ai/usage
```

Do not publish these as live simply because they are documented here.


---

# 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-orchestration-contracts.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.
