API Integration
Overview
Integrate the Agent Platform API into your application.
The Agent Platform provides an API for executing LLM inferences with integrated server-side tool calling.
You send a single request to the platform containing your prompt and a list of tool IDs. The platform handles the communication with the LLM, executes any requested tools natively on its infrastructure, and streams the final output back to your application via Server-Sent Events (SSE).
Authentication
API requests require two forms of authentication:
- Provider Credentials: The API key and base URL for your upstream LLM provider (e.g., Fireworks, OpenAI, Anthropic). These are passed via the
API_KEYandBASE_URLheaders. - Platform Token: Your Agent Platform authentication token, passed as a standard
Authorization: Bearer <TOKEN>header.
Documentation
- Message History: Learn how to format system, user, assistant, and tool messages for the API request.
- API Design Shape: Details on the Server-Sent Events (SSE) stream lifecycle.
- Using the Library: Instructions for using the official
@waqi-agent/aiTypeScript client.