Skip to main content

API Documentation

Welcome to the Kie.ai API documentation. This guide will help you understand how to use our API services effectively.

API Services Overview

We currently offer the following API services:

  1. DeepSeek - Large language model API endpoints powered by DeepSeek

    • Real-time conversation interfaces
    • Context-aware responses
    • Stream response support
  2. Runway - AI video generation endpoints using Runway's generative video models

    • Text-to-video generation
    • Image-to-video transformation
    • Callback notifications
  3. Suno - AI audio generation services for creating music and vocal content

    • Music generation with or without lyrics
    • Lyrics creation with timestamped support
    • WAV format high-quality audio
    • Vocal removal and track separation
    • MP4 video generation from audio tracks
  4. Account - Endpoints for managing account information, credit balances, and usage quotas

    • Credit balance checking
    • Usage tracking

Basic Information

  • API Server: https://kieai.erweima.ai
  • API Version: 1.0.0
  • Technical Support: [email protected]

Authentication

All APIs require Bearer Token authentication:

Authorization: Bearer YOUR_API_KEY

To get your API key:

  1. Visit API Key Management Page
  2. Generate your personal API key
  3. Use it in all API requests

Important:

  • Keep your API key secure
  • Never share your API key
  • Reset immediately if compromised

API Services

DeepSeek Chat

The DeepSeek Chat API provides advanced natural language processing capabilities:

  • Real-time conversation interface via /api/v1/chat/completions
  • Support for various parameters like temperature, max_tokens, and top_p
  • Stream response for immediate feedback
  • Function calling capability
  • JSON output format support

Learn more about Chat API →

Runway Video Generation

The Runway API enables AI-powered video generation:

  • Create videos from text prompts via /api/v1/runway/generate
  • Transform images into videos with textual guidance
  • Support for different aspect ratios (16:9 or 9:16)
  • Webhook callbacks for asynchronous processing
  • Query generation status via /api/v1/runway/record-detail

Key features:

  • Generated videos are stored for 14 days
  • Video generation is asynchronous with callbacks
  • Both text-only and image-based generation supported

Learn more about Runway API →

Suno Audio Generation

The Suno API provides AI-powered audio and music generation capabilities:

Audio Generation

  • Create music tracks from text prompts via /api/v1/generate
  • Support for both instrumental and vocal music
  • Custom and non-custom generation modes
  • Audio extension capabilities for existing tracks
  • Timestamped lyrics support

Key features:

  • Generated audio files are stored for 14 days
  • Asynchronous processing with callback notifications
  • Multiple model versions (V3.5 and V4) support

Lyrics Generation

  • Generate song lyrics based on text prompts
  • Create structured lyrical content for music tracks
  • Query and retrieve lyrics generation task details

WAV Format Audio

  • Generate high-quality WAV format audio files
  • Ideal for professional audio production workflows
  • Enhanced audio quality compared to standard formats

Vocal Removal

  • Separate vocals from instrumental tracks
  • Extract vocal and instrumental components from audio files
  • Process existing audio to create isolated tracks

MP4 Generation

  • Generate MP4 videos from audio tracks via /api/v1/mp4/generate
  • Create visual music videos from generated songs
  • Query MP4 generation task details via /api/v1/mp4/record-info
  • Asynchronous processing with task status tracking

Learn more about Suno API →

Credits Management

Monitor and manage your API usage through the credits system:

  • Check remaining credits via /api/v1/chat/credit
  • Track usage history
  • Set up usage alerts

Learn more about Credits →

Error Handling

Our APIs use standard HTTP status codes along with detailed error messages:

CodeDescription
100Executed - To be executed
200Success - The request was successful
300Answering
401Unauthorized - Authentication is required or failed
402Exhausted Times - The number of times has been used up
404Not Found - Invalid request method or path
422Incorrect Parameters - Wrong Parameter Code
429Insufficient Credits - Account has insufficient credits
500Server Error - Internal server error occurred
505Chat Disabled - Chat Disable Error Code

Best Practices

  1. Authentication

    • Store your API key securely
    • Rotate keys periodically for enhanced security
    • Implement proper error handling for authentication failures
  2. DeepSeek Chat

    • Set appropriate temperature values based on your creativity needs
    • Use streaming for responsive user interfaces
    • Leverage system messages to guide model behavior
  3. Runway Video Generation

    • Implement robust callback handling for asynchronous results
    • Store taskIds for status checking
    • Prepare for 14-day video expiration in your applications
  4. Suno Audio Generation

    • Choose appropriate model versions based on your quality requirements
    • Use custom mode for more control over music generation
    • Implement proper callback handling for all generation stages
    • Consider using WAV format for professional audio applications
    • Leverage vocal removal for audio processing workflows
    • Use MP4 generation to create visual content from your audio tracks
  5. Credits Management

    • Monitor credit usage regularly
    • Implement fallback mechanisms for depleted credits
    • Consider caching responses where appropriate

Need Help?

If you encounter any issues or have questions, please contact us through:

Language Support

This documentation is available in both English and Chinese. You can switch languages using the language selector in the navigation bar.