OAuth
API reference for OAuth
Get authenticated identity
Authorization
bearerAuth API key in format: eur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In: header
Response Body
application/json
curl -X GET "https://api.eurouter.ai/api/v1/me"{
"user_id": "string",
"email": "string",
"org_name": "string",
"org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",
"plan": "string",
"credits": {
"balance": "string",
"total_credits": "string",
"total_usage": "string"
}
}Create authorization code (consent flow)
Authorization
bearerAuth API key in format: eur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://api.eurouter.ai/api/v1/auth/keys/authorize" \ -H "Content-Type: application/json" \ -d '{ "callback_url": "http://example.com", "code_challenge": "stringstringstringstringstringstringstrings", "code_challenge_method": "S256" }'{
"code": "string",
"created_at": "string"
}Create authorization code (programmatic)
Authorization
bearerAuth API key in format: eur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://api.eurouter.ai/api/v1/auth/keys/code" \ -H "Content-Type: application/json" \ -d '{ "callback_url": "http://example.com", "code_challenge": "stringstringstringstringstringstringstrings", "code_challenge_method": "S256" }'{
"code": "string",
"created_at": "string"
}Exchange authorization code for API key
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://api.eurouter.ai/api/v1/auth/keys" \ -H "Content-Type: application/json" \ -d '{ "code": "string", "code_verifier": "stringstringstringstringstringstringstrings" }'{
"key": "string",
"user_id": "string"
}Begin OAuth authorization (browser redirect)
Query Parameters
URL to redirect back to after authorization
uriBase64url-encoded PKCE code challenge
43 <= length <= 128PKCE code challenge method (S256 recommended)
"S256""S256" | "plain"Opaque client state echoed back unchanged to the callback flow
Optional OAuth response type accepted for compatibility with hosted OAuth clients
"code"Optional OAuth client identifier accepted for compatibility with hosted OAuth clients
Optional OAuth redirect URI accepted for compatibility; must match callback_url when both are present
uriResponse Body
curl -X GET "https://api.eurouter.ai/api/v1/auth?callback_url=http%3A%2F%2Fexample.com&code_challenge=stringstringstringstringstringstringstrings&code_challenge_method=S256"