The canonical specification for AI Protocols — a unified standard for interacting with AI models across providers and languages.
AI Protocols defines a consistent, language-agnostic interface for:
- Sending requests to AI models
- Receiving structured responses
- Streaming outputs in real-time
- Defining and executing tools/functions
- Managing conversation state and metadata
This repository contains the canonical JSON Schema definitions, along with documentation and examples.
schema/ → JSON Schema definitions (source of truth)
docs/ → Human-readable documentation for each schema
examples/ → Example payloads and usage patterns
ai-request.json→ Model input definitionai-response.json→ Model output structurestream-event.json→ Streaming event protocolmessage.json→ Message structuretool.json→ Tool/function definitionconversation.json→ Optional conversation structure
Each schema is fully documented:
docs/ai-request.mddocs/ai-response.mddocs/stream-event.mddocs/message.mddocs/tool.mddocs/conversation.md
Real-world usage examples:
Abstracts differences between AI providers into a unified format.
JSON Schema enables generation of types and models across ecosystems.
A unified event-based streaming protocol across all providers.
Standardized function/tool calling interface.
Supports structured context through:
conversation_idcontext_key
v0.x— experimental, subject to breaking changesv1.0— stable contract
This specification is in early development (v0.x). Breaking changes are expected until v1.0.
Contributions are welcome.
Before contributing:
- Follow existing schema structure
- Keep changes provider-agnostic
- Update documentation and examples alongside schema changes