👨‍🎨DALL-E-3

Create a new user

POST /dalle

Prompt DALL-E-3 for an image

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

prompt

string

Image prompt

Response

{
  "data": "d2VsbF9oZWxsb190aGVyZV90Lm1lL3N5bmFwc2VfbGFicw....."
}

Example

example.js
const res = await fetch('https://synapselabs.onrender.com/dalle', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <your_api_key>'
  },
  body: JSON.stringify({
    prompt: 'A cat',
  }),
});

const data = await res.json();
const buf = Buffer.from(data.data, 'base64');
fs.writeFileSync('test.png', buf);

Last updated