Overview
The AI Pass REST API lets you integrate from any platform without using our JavaScript SDK. Perfect for:
Flutter / Dart
Python
PHP
CLI Tools
Desktop Apps
Backend Services
When to Use REST vs SDK
Use REST API when:
- Building mobile apps (Flutter, React Native, etc.)
- Working with backend languages (Python, PHP, Go, etc.)
- Creating CLI tools or desktop applications
- You need full control over the authentication flow
Use JavaScript SDK when:
- Building web applications
- You want ready-to-use UI components
- You need automatic token management
- You want to get started quickly
Quick Start
Authentication Flow (OAuth2 + PKCE)
- Get a client ID from the Developer Dashboard
- Generate PKCE code verifier and challenge
- Redirect user to
/oauth2/authorize - Exchange authorization code for access token
- Call AI APIs with Bearer token
CORS is enabled on
/oauth2/token, so mobile and web apps can exchange codes directly
without a backend.
Example: Chat Completion
curl -X POST https://aipass.one/oauth2/v1/chat/completions \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'
Documentation
Explore our comprehensive REST API documentation:
Complete Integration Guide PHP Examples Developer DashboardKey Endpoints
- OAuth:
/oauth2/authorize,/oauth2/token - Chat:
POST /oauth2/v1/chat/completions - Images:
POST /oauth2/v1/images/generations - Audio:
POST /oauth2/v1/audio/speech,POST /oauth2/v1/audio/transcriptions - Balance:
GET /api/v1/usage/me/summary