Skip to content
allitBeta
  • Models
  • UBIA
  • Chat
  • Hub
  • Studio
  • Pricing
  • API
  • Privacy
    • $ALL
    • WIT
    • Auction
    • Staking
Connect walletTry free
allitBeta
  • Models
  • UBIA
  • Chat
  • Hub
  • Studio
  • Pricing
  • API
  • Privacy

Token

  • $ALL
  • WIT
  • Auction
  • Staking
Try freeConnect wallet
Docs / Images
  • Getting started

    • Allwit docs
    • Wallet sign-in
  • $ALL token

    • $ALL token
    • Launch auction
    • Staking
    • Buyback and burn
  • WIT credits

    • WIT credits
    • The daily allowance
    • Buy WIT credits
    • Pricing and spending
  • Platform

    • Privacy and labels
    • Models
    • Hub
    • Agent Studio
  • API

    • Developer API
    • Authentication
    • Models and pricing
    • Chat completions
    • Images
    • Transcriptions
    • Speech
    • Videos
    • Errors
    • Rate limits
  • Reference

    • Parameters
    • Risks and disclaimer
  • Community

    • X
Docs
  • Getting started

    • Allwit docs
    • Wallet sign-in
  • $ALL token

    • $ALL token
    • Launch auction
    • Staking
    • Buyback and burn
  • WIT credits

    • WIT credits
    • The daily allowance
    • Buy WIT credits
    • Pricing and spending
  • Platform

    • Privacy and labels
    • Models
    • Hub
    • Agent Studio
  • API

    • Developer API
    • Authentication
    • Models and pricing
    • Chat completions
    • Images
    • Transcriptions
    • Speech
    • Videos
    • Errors
    • Rate limits
  • Reference

    • Parameters
    • Risks and disclaimer
  • Community

    • X

API

Images

POST /images/generations: images as base64, priced per image.

Request

`POST /images/generations` takes `prompt`, optional `model` (an image model id from `/models`), `n` (1 to 4), `size` (each model lists its sizes on `/models`; the default is `1024x1024`) and `quality` (`low`, `medium` or `high`; the default is the provider's medium). Images are returned as `b64_json` only: Allwit keeps no copy of your images, so there is nothing to serve from a URL, and `response_format: "url"` is refused with 400.

The WIT reserved and charged is the model's `per_request` price times `n`, whatever the size or quality.

Pythonpython
from openai import OpenAI

client = OpenAI(
    base_url="https://www.allwit.ai/api/v1",
    api_key="aw_live_…",  # from /app/account/api-keys
)

import base64

result = client.images.generate(
    model="<an image model id from GET /models>",
    prompt="A lighthouse at dusk, long exposure",
    n=1,
    response_format="b64_json",
)
open("lighthouse.png", "wb").write(base64.b64decode(result.data[0].b64_json))
JavaScriptjavascript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://www.allwit.ai/api/v1",
  apiKey: process.env.ALLWIT_API_KEY, // aw_live_…
});

const result = await client.images.generate({
  model: "<an image model id from GET /models>",
  prompt: "A lighthouse at dusk, long exposure",
  n: 1,
  response_format: "b64_json",
});
await fs.promises.writeFile("lighthouse.png", Buffer.from(result.data[0].b64_json, "base64"));
curlbash
curl https://www.allwit.ai/api/v1/images/generations \
  -H "Authorization: Bearer $ALLWIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "<image model id>", "prompt": "A lighthouse at dusk", "n": 1}'
PreviousChat completionsNext Transcriptions

On this page

  1. Request
allit

Intelligence, open to everyone. One gateway to every AI model.

  • Allwit on X

© 2026 Allwit

Product

  • Models
  • Chat
  • Hub
  • Agent Studio
  • Pricing
  • UBIA

Developers

  • API
  • Docs
  • Whitepaper

Token

  • $ALL
  • WIT
  • Auction
  • Staking

Legal

  • Privacy
  • Terms
  • Cookies
  • Cookie settings

    Allwit uses no advertising or analytics cookies. Here is what it keeps in this browser.

    Strictly necessary

    The sign-in cookie and your chat history. Needed for Allwit to work.

    Always on

    Remember your light or dark theme on this device.

    Analytics and advertising cookies

    None. Page views are counted without cookies by analytics Allwit hosts itself, which stores nothing in your browser and never sees your wallet address. No advertising.

    No cookies

    Chat history

    Conversations saved in this browser. Deleting them here does not touch any encrypted copies you chose to sync. Manage encrypted history sync

    Read the cookie policy