Generate image
POST
/v1/images/generations
const url = 'https://api.wraitherix.com/v1/images/generations';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"model":"gpt-image-2.5","prompt":"A watercolor fox in a misty forest","size":"1024x1024"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.wraitherix.com/v1/images/generations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model": "gpt-image-2.5", "prompt": "A watercolor fox in a misty forest", "size": "1024x1024" }'Creates images from a text prompt. Billed per image.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
model
required
string
prompt
required
string
n
integer
size
string
quality
string
background
string
Example
{ "model": "gpt-image-2.5", "prompt": "A watercolor fox in a misty forest", "size": "1024x1024"}Responses
Section titled “Responses”Generated images (base64).
Media typeapplication/json
object
created
integer
data
Array<object>
object
b64_json
string
url
string
revised_prompt
string
Example generated
{ "created": 1, "data": [ { "b64_json": "example", "url": "example", "revised_prompt": "example" } ]}The request is malformed or a parameter is invalid.
Media typeapplication/json
object
error
object
message
string
type
string
param
string
code
string
Example
{ "error": { "message": "Invalid request body", "type": "invalid_request_error", "param": "", "code": "invalid_request" }}Missing or invalid API key.
Media typeapplication/json
object
error
object
message
string
type
string
param
string
code
string
Example
{ "error": { "message": "Invalid API key", "type": "api_error", "param": "", "code": "" }}Not enough credits on the account, or the key has reached its own credit limit.
Media typeapplication/json
object
error
object
message
string
type
string
param
string
code
string
Example
{ "error": { "message": "Insufficient balance", "type": "api_error", "param": "", "code": "insufficient_user_quota" }}