Feixiaohao AIDocs
Product GuideTrading & SecurityListing & TrustDeveloper API
Open AIAI
Docs Home
Product Guide
  • Quick StartStart
  • Research & Data Standards
  • Explore & News
  • Alerts, Review & AI Studio
  • Account, Fei Diamonds & AI Memory
  • Community, Articles & Clubs
  • Live Streams & Red Packets
  • Events, FXH ID & Fei Diamonds
Trading & Security
  • Trading Overview
  • Wallets & Fund SecurityCore
Listing & Trust
  • Get Listed & Updates
  • FAQ
  • Terms & Risk Disclosure
  • Changelog
Developer API
  • API Quick Start & AuthAllowlist
  • Chat, Vision & Conversations
  • TTS Audio & AI Images
  • Errors, Limits & Code Examples
Back to Feixiaohao AI
Docs/Developer API/API Quick Start & Auth

API Quick Start & Auth

Allowlist scope, primary and backup base URLs, Bearer authentication, failover rules, anonymous user IDs, and idempotency for the Feixiaohao AI API v1.

Updated 2026-12-02
Ask Feixiaohao AI
Important

Allowlist Access Only: The Feixiaohao AI Developer API is currently open to allowlisted users and partner organizations only; self-service API key issuance is not yet available. To request allowlist access, enable optional sub-capabilities (vision, TTS, AI images), or customize quotas, apply through official channels.

The Feixiaohao AI API (v1) delivers server-side conversational intelligence for crypto assets, US equities and tokenized stocks, and real-time market data, along with multimodal image vision, conversation history management, text-to-speech (TTS), and AI image generation.

Core Parameters & Endpoints

PropertyValue
API Versionv1 (backward-compatible)
Primary Base URLhttps://feixiaohao.io/api/partner/v1
Backup Base URLhttps://fxh.one/api/partner/v1
ProtocolsHTTPS (TLS 1.2+), JSON (UTF-8), SSE (text/event-stream; charset=utf-8), multipart/form-data, binary (audio/mpeg, image/png)
AuthenticationAuthorization: Bearer <API_KEY> (server-to-server only)
Quota & Reporting TimezoneAsia/Shanghai (UTC+8)
ModuleMethod & PathDescription
ChatPOST /api/partner/v1/chatStart a turn (text plus 1-3 inline images, SSE streaming or sync JSON)
ChatPOST /api/partner/v1/chat/{run_id}/cancelStop an in-flight response
HistoryPOST /api/partner/v1/conversationsPre-create an empty conversation (optional; first turn auto-creates)
HistoryGET /api/partner/v1/conversationsList conversations for a user_id
HistoryGET /api/partner/v1/conversations/{conversation_id}/messagesFetch sanitized message history for a conversation
HistoryDELETE /api/partner/v1/conversations/{conversation_id}Delete an idle conversation
AudioPOST /api/partner/v1/audio/speechText-to-speech returning streamed or buffered 128 kbps MP3
AudioPOST /api/partner/v1/audio/speech-with-timestampsText-to-speech with word-level millisecond timestamps
ImagesPOST /api/partner/v1/images/generationsAI image generation and reference editing (b64_json or binary PNG)
ImagesPOST /api/partner/v1/images/polishPrompt polishing and creative inspiration

Compatibility Contract

  • Response objects may add optional fields over time; clients must ignore unknown fields when parsing JSON.
  • JSON request bodies use strict validation and reject undefined fields with 422 INVALID_REQUEST.

Quick Start

bash
export PARTNER_API_KEY="pk_demo_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Primary base URL; switch to https://fxh.one/api/partner/v1 on network or gateway failures
export PARTNER_API_BASE="https://feixiaohao.io/api/partner/v1"

# 1) Streaming chat (default)
curl -N --max-time 660 "$PARTNER_API_BASE/chat" \
  -H "Authorization: Bearer $PARTNER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "u_anon_9f2c1a8b",
    "message": "What is the latest BTC price and 24h change?",
    "request_id": "req-quickstart-001"
  }'

# 2) Synchronous single JSON response
curl --max-time 660 "$PARTNER_API_BASE/chat" \
  -H "Authorization: Bearer $PARTNER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "u_anon_9f2c1a8b",
    "message": "What is the latest BTC price and 24h change?",
    "request_id": "req-quickstart-002",
    "stream": false
  }'

Authentication, Security & Failover

  • Server-side only: Store the API key in backend environment variables or a KMS. Never expose it in frontend bundles, mobile binaries, public repositories, or logs. No CORS headers are emitted for browser-direct calls.
  • Per-tenant sub-capability gates: Standard text chat is active whenever the API channel is enabled. Cost-bearing or extended sub-capabilities (vision, TTS, AI images) are enabled per allowlisted tenant; disabled capabilities return 403 CAPABILITY_DISABLED.
  • Zero-downtime rotation: Multiple active keys are supported per tenant. Revoking a key takes effect immediately and aborts active streams with 401 PARTNER_SESSION_CHANGED.
  • Use bare HTTPS domains and disable redirects: Always target the bare domain (never www.) and disable automatic 3xx redirect following in your HTTP client to prevent leaking or stripping Authorization headers.

Both the primary base (https://feixiaohao.io/api/partner/v1) and backup base (https://fxh.one/api/partner/v1) route to the same cluster and share keys, user_id, conversation_id, and idempotency records:

Failure ConditionFail Over to Backup?request_id Handling
DNS/TCP/TLS failure, header timeout, disconnect before headersYesReuse original request_id on /chat
Gateway HTTP 502 / 503 / 504 (non-JSON, or SERVICE_RESTARTING / MODEL_UNAVAILABLE)YesReuse original request_id on /chat
Read-only GET /conversations* transient network or gateway errorYesNot applicable
Sync chat business HTTP 502 (JSON contains error.run_id)OptionalMust generate a new request_id
HTTP 400 / 401 / 402 / 403 / 404 / 409 / 413 / 415 / 422NoDo not retry
SSE or audio stream disconnects after bytes started arrivingNoGenerate a new request_id to re-ask

Anonymous user_id & Idempotency (request_id)

  • user_id: 1-128 trimmed characters. Required for chat and conversation routes; optional (recommended) for audio and image routes to isolate per-user rate limits. Use a stable irreversible identifier such as HMAC-SHA256 of your internal UID; never pass plain PII such as phone numbers, emails, or real names.
  • conversation_id: Standard UUID. Omit on the first turn to auto-create and pass back on follow-ups. Each user may hold up to 100 active conversations (oldest idle archived automatically) and 100 messages per conversation; only 1 active run is allowed per conversation at a time.
  • request_id (POST /chat idempotency key): Recommended UUID v4 (1-100 chars matching ^[A-Za-z0-9_-]+$). Replays verify exact consistency across user_id, message (plus SHA-256 digests of any attached images), and conversation_id:
    • Previous status completed: Replays the original answer with "replayed": true (SSE replays omit id: lines).
    • Previous status running: Returns 409 RUN_ACTIVE.
    • Previous status failed / cancelled, or mismatched payload: Returns 409 DUPLICATE_REQUEST (use a fresh request_id).
PreviousChangelogNextChat, Vision & Conversations
AI responses are informational only and do not constitute investment advice.
TermsRisk Disclosurellms.txt
On this page
  • Core Parameters & Endpoints
  • Quick Start
  • Authentication, Security & Failover
  • Anonymous userid & Idempotency (requestid)
Quick Actions
Ask Feixiaohao AI