Skip to content
Request
Response

OAuth

OAuth 2.0 for third-party authorization.

Authorization Endpoint

GET https://ai-tokenhub.com/oauth/authorize

Token Endpoint

POST https://ai-tokenhub.com/oauth/token

Authorization Flow

1. Request Authorization

https://ai-tokenhub.com/oauth/authorize?
  client_id=YOUR_CLIENT_ID&
  redirect_uri=https://yourapp.com/callback&
  response_type=code&
  scope=read:user%20write:api

2. Exchange Code for Token

bash
curl -X POST https://ai-tokenhub.com/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d '{
    "grant_type": "authorization_code",
    "code": "AUTH_CODE",
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET"
  }'

Scopes

ScopeDescription
read:userRead user info
write:userModify user info
read:apiRead API usage
write:apiManage API keys
read:billingRead billing info