Frequently Asked Questions
Find answers to common questions about ApiSmart API Keys, models, text, image and video generation, billing, usage, and API errors.
Find quick answers to common questions about using the ApiSmart API.
For detailed integration examples, see Quick Start or the corresponding API guide.
🔑 API Access
What is the ApiSmart API Base URL?
Use:
https://gw.apismart.ai/v1All authenticated requests use an API Key in the Authorization header:
Authorization: Bearer <your-api-key>Where do I use my API Key?
Include your API Key in the Authorization header of each authenticated API request.
Do not expose API Keys in frontend code, public repositories, screenshots, or application logs.
See Create and Manage API Keys and Secure Your API Keys.
Why am I getting 401 invalid_api_key?
This means your API Key could not be authenticated.
Check that the key is correct and that your header uses:
Authorization: Bearer <your-api-key>For more help, see API Key and Authentication Issues.
🧩 Models
How do I find available model IDs?
Call:
Use the returned data[].id value in your API requests.
Why does a model ID have to match exactly?
ApiSmart matches model IDs exactly. Periods, hyphens, and version numbers cannot be changed.
For example:
An incorrectly written model ID may result in an unexpected 503, so verify the model ID character by character.
Why do I get 403 model_not_allowed even though the model appears in /v1/models?
GET /v1/models returns the system model list, but not every model is necessarily enabled for every API Key.
A 403 model_not_allowed response means the selected model is not currently available to your account or API Key.
See Models and Model IDs for details.
💬 Text Generation
Which endpoint should I use for text models?
Use:
ApiSmart text models use an OpenAI-compatible Chat Completions request format.
Does Chat Completions support streaming?
Yes.
Add:
to the request body to enable streaming output.
See Chat Completions API and Response Modes.
🖼️ Image Generation
How long does image generation take?
Image generation is synchronous by default.
A single image typically takes around 20–40 seconds. High-resolution, multi-reference, or sequential image generation may take longer.
Set your client timeout to at least 90 seconds.
Can I use reference images?
Yes.
The Image Generation API supports:
Text-to-image
Single reference image
Multiple reference images
Sequential image generation
Streaming output
Up to 14 reference images are supported, subject to the documented image limits.
See Image Generation API for complete requirements.
Can I upload a local image?
Yes.
Use:
with multipart form data.
Each uploaded image must be no larger than 10 MB, and up to 14 reference images are supported.
Where can I find previously generated images?
Use:
to retrieve recent image generation history.
The history API currently allows you to query records from the most recent 7 days.
🎬 Video Generation
Is video generation synchronous?
No.
Video generation uses an asynchronous task workflow:
Your application should create the task and then query its status until generation completes.
What video task statuses can I receive?
Possible statuses include:
queued
Waiting in queue
running
Generation in progress
succeeded
Generation completed
failed
Generation failed
cancelled
Task cancelled
expired
Task expired
Continue polling while the task is queued or running.
Why should I specify video resolution and duration explicitly?
Video billing and supported settings vary by model.
For example, HappyHorse defaults to 1080p billing when resolution is omitted and 5 seconds when duration is omitted. Seedance uses different resolution rules.
To avoid unexpected costs or unsupported settings, specify these parameters explicitly where recommended.
See Video Generation API and Model Pricing and Billing.
Where can I find previously generated videos?
Use:
The endpoint returns recently completed successful video generations.
Only the most recent 7 days can currently be queried, and queued, running, or failed tasks are not included.
For active tasks, use GET /v1/video/tasks/{id} instead.
💰 Billing and Usage
How are API requests billed?
Billing depends on the selected model and workload.
Text, image, and video models can use different billing methods. Image generation may be billed by delivered image results, while video pricing can depend on model, duration, resolution, or generated tokens.
For current pricing and billing rules, see Model Pricing and Billing.
What does 402 insufficient_quota mean?
Your account does not have sufficient available balance to complete the request.
Check your wallet balance and recent usage before retrying.
See Balance and Usage Limit Issues.
What does 429 rate_limit_error mean?
The service rate limit has been reached.
Reduce request frequency and retry later using controlled backoff. It does not mean that your wallet balance is insufficient.
⚠️ Errors and Troubleshooting
What should I do if I receive a 502, 503, or 504?
These errors can indicate temporary provider, gateway, or network-layer problems.
Use controlled retries with exponential backoff. If the response includes Retry-After, follow it where applicable.
For an unexpected 503, also verify the model ID first.
See Timeout and Connection Issues.
Where can I check failed requests and costs?
Use Usage Logs and Costs to review request-level information such as model, status, consumption, cost, and Request ID.
When contacting ApiSmart Support about an API request, provide the relevant Request ID when available.
Never provide your full API Key.
➡️ Need More Help?
Continue with:
Quick Start — Send your first API request
Models and Model IDs — Find valid models
Model Pricing and Billing — Understand API costs
Usage Logs and Costs — Review request activity
HTTP Status Codes and API Errors — Look up API errors
Contact Support — Get additional assistance
最後更新於
這有幫助嗎?