External integration only needs two steps: call invite registration to get the user profile and default API key, then use that API key against the OpenAI-compatible AI endpoint.
Used for third-party auto onboarding. It requires inviter_id, email, and key_name. The service looks up API key by user + key_name and creates one only when missing.
POST /api/auth/register
Content-Type: application/json
{
"email": "user@example.com",
"inviter_id": 10001,
"key_name": "goodhr"
}{
"code": 0,
"message": "success",
"data": {
"user": {
"id": 20001,
"email": "user@example.com",
"nickname": "user",
"role": "user",
"inviter_id": 10001
},
"api_key": {
"id": 30001,
"name": "goodhr",
"key": "sk-xxxx",
"key_prefix": "sk-xxxx"
},
"balance": "0.2",
"cny_balance": "1.44",
"is_new_user": true
}
}External AI traffic goes through OpenAI-compatible endpoints. After getting the API key from invite registration, call `/v1/chat/completions`, `/v1/embeddings`, or `/v1/images/generations` directly.
POST /v1/chat/completions
Content-Type: application/json
Authorization: Bearer sk-xxxx
{
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "Write a short product introduction"
}
]
}{
"id": "chatcmpl-xxx",
"object": "chat.completion",
"created": 1776746375,
"model": "gpt-4o",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Here is the generated response"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 48,
"total_tokens": 60
}
}If you are building third-party onboarding or a referral workflow, start with invite registration first and add the public query endpoints as needed.
© 2026 FlowHubLLM. All rights reserved.