Skip to main content
Building with AI? Drop llms-full.txt into Cursor, Claude, ChatGPT, or any LLM-powered editor to load the entire Legnext API spec — every endpoint, parameter, and example — in one shot. See llms.txt for the index.

1. Generate an API Key

Get your API key from the Legnext dashboard to authenticate your requests.
Never share your API key with anyone. Keep it secure and never commit it to version control.

2. Set URL and Endpoint

All API requests are made to our base URL with specific endpoints:
For example: https://api.legnext.ai/api/v1/diffusion

3. Headers

All API requests must include the following headers:

4. Make Your First API Call

Generate your first image using our text-to-image endpoint:

5. Response Format

All endpoints return a Job object containing:
  • job_id: Unique job identifier
  • status: Processing status (pending, processing, completed, failed)
  • output: Contains result image URLs when completed
  • meta: Usage and timing information
  • error: Error details if task failed

6. Error Codes & Handling

When a request fails, the API returns an HTTP error status code along with an error object:

HTTP Status Codes

All error responses include a code field matching the HTTP status code and a message field with a human-readable description. Check these fields to understand what went wrong.

7. Next Steps

Start exploring our powerful image generation capabilities!

Important

Please read our Notice before using the API to understand supported models and current limitations.