Quick Start
Get started with ApiSmart in minutes. Create an API Key, find an available model, and send your first text, image, or video API request.
Get up and running with ApiSmart in just a few steps.
This guide will show you how to create an API Key, find an available model, and send your first API request.
🚀 Before You Start
Make sure you have:
An ApiSmart account
Sufficient wallet balance for the model you want to use
An API Key
If you haven't created an account or added funds yet, see Create and Access Your Account and Add Funds and Understand Wallet Credits.
🔑 Step 1: Create an API Key
Sign in to the ApiSmart Console and go to:
Console → API Keys
Click Create API Key and create a credential for your application.
Your API Key is used to authenticate API requests.
Throughout this documentation, we use:
<your-api-key>
Replace this placeholder with your actual API Key when sending a request.
Keep your API Key secure. Do not expose it in public repositories, browser-side code, or other publicly accessible locations.
For key management and security best practices, see API Keys.
🔗 Step 2: Configure the API
The standard ApiSmart API Base URL is:
https://gw.apismart.ai/v1
Authenticate requests using the Authorization header:
For JSON requests, also include:
🧩 Step 3: Find a Model
Before making a request, you can retrieve the current model list:
Example response:
Use the value returned in data[].id as the model parameter in your API request.
Model IDs must match exactly. Pay attention to periods (
.), hyphens (-), and version numbers.
The Models API may return models that are not enabled for every API Key. If a request returns 403 model_not_allowed, the selected model is not currently available to your API Key.
For more information, see Models and Model IDs.
💬 Step 4: Send Your First Request
The fastest way to test your integration is with the Chat Completions API.
Send a request to:
POST /v1/chat/completions
If the request succeeds, the API returns a response generated by the selected model.
You have now completed your first ApiSmart API request.
🖼️ Optional: Try Image Generation
To generate an image, use:
POST /v1/images/generations
Example:
Image generation is synchronous, so the connection remains open until generation completes.
For longer-running requests, set your client timeout to at least 90 seconds.
For supported parameters, reference images, image editing, and streaming, see Image Generation API.
🎬 Optional: Try Video Generation
Video generation uses asynchronous tasks.
Create a task with:
POST /v1/video/tasks
The API returns a task ID.
Use it to check the task status:
Continue checking until the task reaches a final status such as succeeded or failed.
For video requests, explicitly specify parameters such as
resolutionanddurationwhen applicable. These values can affect billing.
For model-specific parameters and supported workflows, see Video Generation API.
✅ You're Ready to Build
You now know how to:
Create an API Key
Configure the ApiSmart API
Retrieve available model IDs
Send a Chat Completions request
Try image or video generation
Continue with the documentation that matches your workflow:
API Keys — Manage and secure your credentials
Models and Model IDs — Find supported models
Model Pricing and Billing — Understand model costs
API Basics — Learn common API conventions
Chat Completions API — Build with text models
Image Generation API — Generate and edit images
Video Generation API — Create video generation workflows
Response Modes — Learn about standard, streaming, and asynchronous responses
最後更新於
這有幫助嗎?