Skip to main content
Version: 1.11.0-beta

upload

Uploads an image file to the ImagineoAI API.

Signature:

client.images.upload(input: UploadImageRequest): Promise<UploadImageResponse>
  • input: { file: UploadFileType; description?: string }
    • file: The image to upload. Accepts:
      • Browser: File or Blob
      • Node.js: Buffer or Readable
    • description (optional): String description of the image.
  • Returns: { image_url: string; run_id: string; created_at: string }
  • Throws: On validation, network, or API error.

Example

const client = new ImagineoAIClient(apiUrl, { apiKey: 'sk-...' });
const file = ... // File, Blob, Buffer, or Readable
const result = await client.images.upload({ file });
console.log(result.image_url);

Notes

  • In the browser, only File or Blob objects are accepted.
  • In Node.js, use Buffer or Readable streams.
  • See the Usage Guide for more details.