Image Generation
AlphaNeural supports OpenAI-compatible image generation for GPT-style image models (and any provider-backed image model you expose through the OpenAI Images interface). The API shape matches OpenAI’s
Last updated
AlphaNeural supports OpenAI-compatible image generation for GPT-style image models (and any provider-backed image model you expose through the OpenAI Images interface). The API shape matches OpenAI’s
Last updated
curl https://proxy.alfnrl.io/v1/images/generations \
-H "Authorization: Bearer $ALPHANEURAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-1",
"prompt": "A cute baby sea otter in a knitted hat, studio lighting",
"size": "1024x1024",
"n": 1
}'from openai import OpenAI
import os, base64
client = OpenAI(api_key=os.environ["ALPHANEURAL_API_KEY"], base_url="https://proxy.alfnrl.io/v1")
r = client.images.generate(model="gpt-image-1", prompt="A tiny robot making espresso, cinematic", size="1024x1024")
img_b64 = r.data[0].b64_json
open("image.png","wb").write(base64.b64decode(img_b64)){
"created": 1730000000,
"data": [
{ "b64_json": "iVBORw0KGgoAAA..." }
]
}import os, base64, requests
r = requests.post(
"https://proxy.alfnrl.io/v1/images/generations",
headers={"Authorization": f"Bearer {os.environ['ALPHANEURAL_API_KEY']}",
"Content-Type": "application/json"},
json={"model":"gpt-image-1","prompt":"A minimal owl logo","size":"1024x1024"}
)
b64 = r.json()["data"][0]["b64_json"]
open("out.png","wb").write(base64.b64decode(b64))