API
Send chat requests through the OpenAI-compatible API.
Use the hosted API to send chat requests without building Solana transactions. It uses your Fossa account wallet to reserve payment, authorize inference, and stream the provider’s reply. The base URL is https://api.fossa.ag/v1.
The API supports GET /models and POST /chat/completions with an OpenAI-compatible request format. Add the optional fossa object to control routing. The OpenCode integration remains available for local signing and direct provider requests.
Endpoints
| Method | Endpoint | Purpose |
|---|---|---|
GET | /v1/models | List models and their capabilities. |
POST | /v1/chat/completions | Send a chat request and read its reply. |
GET | /v1/requests/{requestId} | Inspect request progress and settlement. |
Regional endpoints
Choose an endpoint near your application.
| Base URL | Location | AWS Region |
|---|---|---|
https://api.fossa.ag/v1 (default) | Virginia, United States | us-east-1 |
https://us.fossa.ag/v1 | Virginia, United States | us-east-1 |
https://eu.fossa.ag/v1 | Frankfurt, Germany | eu-central-1 |
https://jp.fossa.ag/v1 | Tokyo, Japan | ap-northeast-1 |
Your API key and account limits apply across all endpoints. See requests and recovery for status checks and retries.
Guides
- Authentication: Create and revoke API keys.
- Models: Choose a model and read its limits.
- Chat completions: Send requests and read streamed replies.
- Routing: Set price, speed, privacy, and token requirements.
- Requests and recovery: Inspect uncertain results and handle retries.
- Errors and limits: Read failures and service limits.