Skip to main content

Prerequisites

Before you start using WeryAI API, you need to complete the following setup:

1. Register and Create API Key

Visit WeryAI API Keys Management to: API Keys Management Page
1

Register or Login

If you don’t have an account yet, register for a WeryAI account
2

Create API Key

On the API Keys page, click the “Create New Key” button to generate your API KeyCreate API Key Button
3

Copy and Save Key

Copy the generated API key and save it securely (key format like: sk-d77e1...343e)Copy API Key
Keep your API key secure! Never share it publicly or commit it to version control. Store it in environment variables.

2. Purchase Credits

Visit the Pricing page to purchase credits: Pricing Page - Credit Balance
  • Check your current account balance
  • Choose a suitable recharge package (50.00to50.00 to 6000.00 multiple tiers)
  • After payment, credits will be added to your account immediately
Credit Packages
Different AI models consume different amounts of credits. You can view the detailed model consumption rate table on the pricing page.
Model Consumption Rates

Authentication

All API requests require authentication using your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Replace YOUR_API_KEY with the actual key you created on the API Keys page.

Your First Request

Let’s generate your first image using the text-to-image API:
curl -X POST https://api.weryai.com/v1/generation/text-to-image \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "FLUX_PRO",
    "prompt": "A beautiful sunset over the ocean, vibrant colors",
    "aspect_ratio": "16:9",
    "resolution": "1080p",
    "image_number": 1
  }'

Response

The API will return a response containing batch_id and task_ids:
{
  "status": 0,
  "desc": "success",
  "message": "success",
  "data": {
    "batch_id": 123456789,
    "task_ids": ["task_abc123"]
  }
}

Query Task Status

Since generation tasks are processed asynchronously, use the task ID to query the status:
curl -X GET https://api.weryai.com/v1/generation/task_abc123/status \
  -H "Authorization: Bearer YOUR_API_KEY"

Success Response

When the task completes, you’ll receive the generated images:
{
  "status": 0,
  "desc": "success",
  "message": "success",
  "data": {
    "task_id": "task_abc123",
    "task_status": "SUCCESS",
    "images": [
      "https://cdn.weryai.com/result/image1.png"
    ]
  }
}

Using Webhooks

You can provide a webhook_url to automatically receive results instead of polling:
{
  "model": "FLUX_PRO",
  "prompt": "A beautiful sunset over the ocean",
  "aspect_ratio": "16:9",
  "webhook_url": "https://your-server.com/webhook"
}
When the task completes, WeryAI will send a POST request with the results to your webhook URL.

Task Status

Tasks can have the following statuses:
  • PENDING - Task is waiting to be processed
  • PROCESSING - Task is being generated
  • SUCCESS - Task completed successfully
  • FAILED - Task failed (check the msg field for error details)

View Call History

You can view all API call records on the Call History page: Call History Page
  • View detailed information for each request
  • Search for specific requests by request ID
  • View request method, path, status code, and duration
  • Convenient for debugging and tracking issues

Next Steps

API Reference

Explore all available endpoints and parameters

Development Guide

Learn best practices and advanced features

Generate Videos

Create stunning videos with AI

View Pricing

Learn about model consumption and purchase credits

FAQ

Check if your API key is correct and properly formatted in the Authorization header. You can view or recreate keys on the API Keys page.
Peak times may cause delays. Tasks usually start processing within a few minutes. You can view request details on the Call History page.
Your prompt may violate content policies. Please review and modify your prompt to avoid sensitive or inappropriate content.
Visit the Pricing page to view your current account credit balance and purchase more credits.
On the Pricing page, scroll down to see the “Model Consumption Rate” table, which lists all models and their credit consumption.
Need help? Visit WeryAI website to contact our support team.