For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DocsAPI ReferenceSDKs
DocsAPI ReferenceSDKs
  • Overview
    • API reference
  • Mesh API
      • POSTGenerate Image
LogoLogo
Mesh APIImages

Generate Image

||View as Markdown|
POST
https://api.meshapi.ai/v1/images/generations
POST
/v1/images/generations
$curl -X POST https://api.meshapi.ai/v1/images/generations \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "prompt": "A futuristic city skyline at sunset, vibrant colors, highly detailed, digital art",
> "model": "dall-e-3",
> "n": 3,
> "quality": "high",
> "response_format": "url",
> "size": "1024x1024",
> "output_format": "png",
> "stream": false
>}'
1{
2 "created": 1687000000,
3 "data": [
4 {
5 "url": "https://images.meshapi.ai/generated/abc123.png"
6 },
7 {
8 "url": "https://images.meshapi.ai/generated/def456.png"
9 },
10 {
11 "url": "https://images.meshapi.ai/generated/ghi789.png"
12 }
13 ]
14}

OpenAI-compatible image generation endpoint.

Was this page helpful?
Previous

Chat Compare

Next

Create Response

Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
promptstringRequired
modelstring or nullOptional
nintegerOptional1-10Defaults to 1
qualitystringOptionalDefaults to auto
response_formatenumOptionalDefaults to url
Allowed values:
sizestringOptionalDefaults to auto
output_formatenum or nullOptional
Allowed values:
streambooleanOptionalDefaults to false

Response

Successful Response

Errors

401
Unauthorized Error
402
Payment Required Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
501
Not Implemented Error