REST API

REST API

WaveSpeedAI provides a RESTful API for programmatic access to 700+ AI models.

Base URL

https://api.wavespeed.ai/api/v3

Authentication

All requests require an API key in the Authorization header:

Authorization: Bearer ${WAVESPEED_API_KEY}

Get your API key at wavespeed.ai/accesskey. Store it as an environment variable for security.

Basic Workflow

  1. Submit a task — Send a POST request with your parameters
  2. Get the task ID — Returned in the response
  3. Poll for results — Check status until completion
  4. Retrieve outputs — Get URLs to generated content

Example Request

# Submit task
curl --location --request POST 'https://api.wavespeed.ai/api/v3/wavespeed-ai/flux-dev' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ${WAVESPEED_API_KEY}' \
--data-raw '{
  "prompt": "A cat wearing a space suit"
}'
 
# Get result (use the task ID from response)
curl --location --request GET 'https://api.wavespeed.ai/api/v3/predictions/TASK_ID' \
--header 'Authorization: Bearer ${WAVESPEED_API_KEY}'

Response Format

Task Submission Response

{
  "code": 200,
  "message": "success",
  "data": {
    "id": "task-abc123",
    "status": "processing",
    "urls": {
      "get": "https://api.wavespeed.ai/api/v3/predictions/task-abc123"
    }
  }
}

Task Result Response

{
  "code": 200,
  "message": "success",
  "data": {
    "id": "task-abc123",
    "status": "completed",
    "outputs": ["https://..."],
    "timings": {
      "inference": 2500
    }
  }
}

Task Status Values

StatusDescription
createdTask received
processingGeneration in progress
completedSuccess, outputs available
failedError occurred

Error Handling

CodeDescription
200Success
400Bad request (invalid parameters)
401Unauthorized (invalid API key)
403Forbidden (account issue)
429Rate limit exceeded
500Server error

API Reference

Model Documentation

Each model has specific parameters. See the Model Library for complete API documentation for each model.

© 2025 WaveSpeedAI. All rights reserved.