FlowHubLLM
Trang chủMô hìnhTin tứcGiới thiệuLiên hệDocs
Đăng nhập
Docs

58AI Developer Docs

This page shows only the two public integration surfaces: invite registration and OpenAI-compatible AI invocation.
Contents
OverviewInvite registrationInvoke AI

Overview

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.

The registration endpoint is for third-party auto onboarding, so end users do not need to sign up manually.
AI invocation uses `/v1` and follows OpenAI-compatible request formats.
Send `Authorization: Bearer sk-...` when calling AI APIs.

Invite registration

POST
/api/auth/register

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.

Request
POST /api/auth/register
Content-Type: application/json

{
  "email": "user@example.com",
  "inviter_id": 10001,
  "key_name": "goodhr"
}
Response
{
  "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
  }
}
inviter_id, email, and key_name are required.
The API key is looked up by "user + key_name"; plaintext key is returned only when a new key is created.
This endpoint is intended for auto onboarding, embedded SaaS flows, and referral commission models.

Invoke AI

POST
/v1/chat/completions

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.

Request
POST /v1/chat/completions
Content-Type: application/json
Authorization: Bearer sk-xxxx

{
  "model": "gpt-4o",
  "messages": [
    {
      "role": "user",
      "content": "Write a short product introduction"
    }
  ]
}
Response
{
  "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
  }
}
The main public integration path is the OpenAI-compatible invocation API.
The same API key can also be used with `/v1/embeddings` and `/v1/images/generations`.
If you only need chat, starting with `/v1/chat/completions` is enough.

Next step

If you are building third-party onboarding or a referral workflow, start with invite registration first and add the public query endpoints as needed.

Contact UsBrowse Models

© 2026 FlowHubLLM. All rights reserved.

Tin tứcGiới thiệuLiên hệ

Điều khoản

Quyền riêng tư

58AI Developer Docs - 58AI