Skip to main content

Authenticate

POST /v1/auth/authenticate

Exchanges an API key for a JWT access token and a refresh token.

No Authorization Required

This endpoint does not require a Bearer token. It is used to obtain one.

Headers

HeaderRequiredValue
Content-TypeYesapplication/json
X-Target-ServerYesauthentication

Request Body

FieldTypeRequiredDescription
api_keystringYesThe full API key string
{
"api_key": "sk-rqc-oat01-e5f6-7890-abcd..."
}

Response

200 OK

Returns the access token, refresh token, and expiration time.

{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_at": "2025-01-01T01:00:00Z",
"created_at": "2025-01-01T00:00:00Z"
}
FieldTypeDescription
tokenstringJWT access token (valid for 1 hour)
refresh_tokenstringRefresh token (valid for 24 hours)
expires_atstring (ISO 8601)Access token expiration time
created_atstring (ISO 8601)Token creation time

400 Bad Request

API key is missing or invalid format.

{
"code": 0,
"domain": 0,
"message": "api_key is required"
}

404 Not Found

API key not found, hash mismatch, expired, or inactive.

{
"code": 0,
"domain": 0,
"message": "api key not found"
}

500 Internal Server Error

{
"code": 0,
"domain": 0,
"message": "internal server error"
}