| title | Introduction |
|---|---|
| description | Routstr API Reference Documentation |
Welcome to the Routstr API documentation. Our API enables you to access AI models through a proxy service to OpenRouter.ai, with integrated wallet functionality for payments using Cashu tokens.
All API requests require authentication using bearer tokens. These tokens are Cashu tokens which contain pre-paid credits.
curl -X POST https://api.routstr.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_CASHU_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}'The Routstr API consists of several core endpoints:
- Proxy Endpoints (
/{path}): All HTTP methods (GET, POST, PUT, DELETE, etc.) are supported for proxying requests to the underlying OpenRouter.ai API.
- Account Info (
/v1/wallet/): Get information about your account and remaining balance. - Topup Balance (
/v1/wallet/topup): Add funds to your account using Cashu tokens. - Refund Balance (
/v1/wallet/refund): Withdraw your remaining balance as a Cashu token.
curl -X GET https://api.routstr.com/v1/wallet/ \
-H "Authorization: Bearer YOUR_CASHU_TOKEN"curl -X POST https://api.routstr.com/v1/wallet/topup?cashu_token=YOUR_NEW_CASHU_TOKEN \
-H "Authorization: Bearer YOUR_EXISTING_CASHU_TOKEN"For developers who prefer to use the OpenAPI specification, you can access our OpenAPI document here.
import ApiDocMdx from './openapi.json';
<ApiDocMdx />;