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/TTS Audio & AI Images

TTS Audio & AI Images

Reference for text-to-speech MP3 synthesis, word-level subtitle timestamps, AI image generation and reference editing, and prompt polish endpoints.

Updated 2026-12-02
Ask Feixiaohao AI
Important

Allowlist & Sub-Capability Gates: The Developer API is allowlist-only. Text-to-speech (/audio/*) and AI image generation/polish (/images/*) are opt-in per tenant and return 403 CAPABILITY_DISABLED until enabled.

Text-to-Speech POST /api/partner/v1/audio/speech

Synthesizes input text into 128 kbps MP3 audio. Markdown syntax, fenced code blocks, tables, citation blocks, and raw URLs are stripped automatically into natural spoken prose; if no spoken text remains, the endpoint returns 400 SPEECH_TEXT_INVALID. Recommended client read timeout: >= 90 seconds.

Request Body (JSON, strict, <= 16 KB)

FieldTypeRequiredDefaultDescription
textstringYes-1-600 trimmed chars; split longer articles by sentence boundaries
voicestringNo"feifei"Voice alias: "feifei" (default), "yutong", "zixuan"
streambooleanNofalsefalse returns full buffered MP3; true streams chunked audio/mpeg
user_idstringNo-1-128 chars, optional anonymous user ID for per-user rate isolation

Success Response (HTTP 200)

  • Body: Binary MP3 audio (Content-Type: audio/mpeg).
  • Headers: X-Audio-Format: mp3, X-Speech-Voice: feifei | yutong | zixuan, X-Content-Type-Options: nosniff, Cache-Control: no-store (X-Accel-Buffering: no when stream: true).
bash
curl --max-time 90 "https://feixiaohao.io/api/partner/v1/audio/speech" \
  -H "Authorization: Bearer $PARTNER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Welcome to the daily digital asset market briefing.","voice":"feifei","user_id":"u_anon_9f2c1a8b"}' \
  --output brief.mp3

Speech with Word Timestamps POST /api/partner/v1/audio/speech-with-timestamps

Returns Base64-encoded MP3 audio, total duration, and millisecond-accurate word timing for synchronized subtitles or voiceover playback.

  • Body (JSON, strict, <= 16 KB): text (required, 1-600 chars), voice (optional), language (optional: "zh", "en", "ko"), user_id (optional).
  • Response (HTTP 200, application/json):
json
{
  "format": "mp3",
  "media_type": "audio/mpeg",
  "voice": "feifei",
  "duration_ms": 2450,
  "audio_base64": "//uQxAAAAAANIAAAAAExBTUUzLjEwMFVVVVVV...",
  "words": [
    { "text": "Welcome", "start_ms": 0, "end_ms": 420 },
    { "text": "to", "start_ms": 420, "end_ms": 580 }
  ]
}

AI Image Generation & Editing POST /api/partner/v1/images/generations

Supports text-to-image generation and editing with up to 3 reference images. Accepts both application/json and multipart/form-data. Server max execution time is 260 seconds; set HTTP read timeout to >= 270 seconds.

Request Parameters

Body size ceilings: 64 KB for JSON without references, 28 MB for JSON with Base64 references, and 24.25 MB for multipart/form-data (repeated file field references):

FieldTypeRequiredDefaultDescription
promptstringYes-1-6,000 trimmed chars (no control characters)
stylestringNo"auto"Visual style preset (see list below)
aspect_ratiostringNo"square"square, landscape, portrait, wide, tall
qualitystringNoServer defaultauto, low, medium, high (unsupported values return 422 IMAGE_SPEC_UNSUPPORTED)
transparentbooleanNofalseOutput transparent PNG ("true" or "1" in multipart)
response_formatstringNo"b64_json""b64_json" (JSON envelope) or "binary" (raw image/png bytes)
user_idstringNo-1-128 chars, optional anonymous user ID for per-user daily cap
request_idstringNoAuto-generated1-100 chars (^[A-Za-z0-9_-]+$), echoed for tracing (images are not cached/replayed)
referencesImageInput[] or filesNo-1-3 PNG, JPEG, or WebP reference images (<= 8 MB each, <= 20 MB total)

Recommended style Presets

auto, minimal-fintech, 3d-render, photorealistic, infographic, flat-illustration, movie-poster, cyberpunk, anime, guofeng, watercolor, pixel-art.

Success Response (HTTP 200)

  • response_format: "b64_json" (default):
json
{
  "request_id": "req-img-001",
  "format": "png",
  "media_type": "image/png",
  "width": 1024,
  "height": 1024,
  "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
  "b64_json": "iVBORw0KGgoAAAANSUhEUgAA...",
  "elapsed_ms": 14820
}
  • response_format: "binary": Returns raw Content-Type: image/png bytes with X-Request-Id, X-Content-SHA256, X-Image-Width, X-Image-Height, and X-Image-Format: png. Generated images are not persisted server-side; store them in your own object storage if needed.

Prompt Polish & Inspiration POST /api/partner/v1/images/polish

Refines a rough draft into a high-craft image prompt (polish mode), or generates a fresh creative prompt when prompt is empty or omitted (inspire mode). Accepts up to 3 PNG/JPEG/WebP reference images to incorporate visual cues.

  • Body (JSON, strict; <= 64 KB without references, <= 28 MB with references): prompt (0-6,000 chars), style, style_hint (<= 300 chars), aspect_ratio, lang ("zh" default or "en"), previous_prompt, user_id, references.
  • Response (HTTP 200):
json
{
  "prompt": "Minimalist deep-navy fintech research cover with fine golden light trajectories, subtle frosted glass depth, generous negative space, soft studio lighting",
  "mode": "polish",
  "source": "model",
  "analyzed_references": 1
}
PreviousChat, Vision & ConversationsNextErrors, Limits & Code Examples
AI responses are informational only and do not constitute investment advice.
TermsRisk Disclosurellms.txt
On this page
  • Text-to-Speech POST /api/partner/v1/audio/speech
  • Request Body (JSON, strict, <= 16 KB)
  • Success Response (HTTP 200)
  • Speech with Word Timestamps POST /api/partner/v1/audio/speech-with-timestamps
  • AI Image Generation & Editing POST /api/partner/v1/images/generations
  • Request Parameters
  • Recommended style Presets
  • Success Response (HTTP 200)
  • Prompt Polish & Inspiration POST /api/partner/v1/images/polish
Quick Actions
Ask Feixiaohao AI