HiAPI
  • Models
  • Pricing
Search

Search HiAPI models, tools, and resources.

  • Models
  • Pricing
HiAPI

One API, All AI Models

Generate images, video, and audio with leading models through one production-ready API.

Get a free API key

AI Image API

  • All image models
  • GPT Image 2
  • Nano Banana 2
  • Seedream 5.0 Pro
  • Qwen Image 2.0 Pro
  • FLUX 1.1 Pro

AI Video API

  • All video models
  • Seedance 2.5
  • FLUX.3 Video
  • Seedance 2.0
  • Veo 3.1
  • Kling 3.0

AI Audio API

  • All audio models
  • MiniMax Music 2.6
  • MiniMax Music 1.5
  • ElevenLabs v3
  • Text to music
  • Text to speech

Product

  • Model marketplace
  • Playground
  • Pricing
  • Image API Cost Calculator
  • Free GPT Image 2 Generator
  • Free Nano Banana Image Generator
  • Outfit Preview
  • Product Photo Lab

Developers

  • Documentation
  • API Reference
  • Agent Skills
  • LLM integration index
  • Blog

Company

  • About
  • Contact support
  • Terms of Service
  • Privacy Policy

© 2026 hiapi. All rights reserved.

Open source on GitHubPython SDK on PyPI
  • Why a gen_id cannot download the image
  • Path 1: the original conversation still exists
  • Path 2: you have a complete ChatGPT data export
  • Path 3: only the gen_id remains
  • Path 4: you need automation
  • A storage pattern that survives expiring links
  • FAQ
  • Is there an official gen_id download endpoint?
  • Can I build a backend-api URL from gen_id?
  • Why does a ChatGPT image URL return 422?
  • Why does the same URL later return 404?
  • How do I create a permanent image URL?
GuideJul 21, 2026

ChatGPT gen_id Download Endpoint: Four Recovery Paths

There is no public endpoint that turns a gen_id into image bytes. Use the recovery path that matches what you still have.

hiapiUpdated Aug 10, 2026troubleshootinggpt-image-2tasks-api

Latest models

Explore models

Contents
  • Why a gen_id cannot download the image
  • Path 1: the original conversation still exists
  • Path 2: you have a complete ChatGPT data export
  • Path 3: only the gen_id remains
  • Path 4: you need automation
  • A storage pattern that survives expiring links
  • FAQ
  • Is there an official gen_id download endpoint?
  • Can I build a backend-api URL from gen_id?
  • Why does a ChatGPT image URL return 422?
  • Why does the same URL later return 404?
  • How do I create a permanent image URL?

Generate it with HiAPI

Choose a model, enter your prompt, and see the result.

HiAPI Blog

Related articles

HiAPI

Generate it with HiAPI

If you are looking for a ChatGPT gen_id download endpoint, the short answer is that no public endpoint turns a gen_id into image bytes. The recovery path depends on what you still have.

What you still haveBest recovery pathWhat not to do
The original conversation is still availableOpen the image in ChatGPT, download it, then re-host the fileDo not copy a backend-api URL into your app
A complete data export with conversations.json and asset filesMatch the file-service:// pointer to the exported fileDo not try to fetch the internal URI with curl
Only a gen_idRecreate the image from the prompt or conversation contextDo not guess private id-to-file endpoints
You need a repeatable automated workflowGenerate through a documented API, download the output, and store your own URLDo not automate against ChatGPT's browser session

The distinction matters: gen_id records which generation a conversation is referring to. It is not a storage key, a public URL, or an API parameter that retrieves the original file.

Why a gen_id cannot download the image

ChatGPT may store several references around one generated image:

  • gen_id identifies a generation inside the conversation so a later turn can refer back to it.
  • file-service://file-... is an internal asset pointer, not an HTTP address.
  • chatgpt.com/backend-api/... and files.oaiusercontent.com/... are temporary, signed pickup URLs used by the ChatGPT web app.

These identifiers solve different internal jobs. None is a permanent public file URL.

That is why common experiments end in two different errors:

HTTP 422
missing query fields such as p or ts

The signed URL was copied without all of its query parameters, or a tool stripped them while pasting.

HTTP 404
ResourceNotFound

The link has expired, the asset is no longer stored, or the request is outside the session that issued it. Reconstructing a plausible URL from gen_id does not restore the signature or the file.

Path 1: the original conversation still exists

Open the conversation in ChatGPT and use the download control on the image. Save the bytes immediately and upload them to storage you control.

If a copied link still works only in your browser, treat that as a last chance to download, not as a link you can publish. Your browser may still have the relevant session and a fresh signature; a backend worker, another user, or a later visit will not.

After recovery, replace every stored ChatGPT link with your own S3, R2, CDN, or application URL.

Path 2: you have a complete ChatGPT data export

A complete export can contain conversations.json plus separate asset files. The JSON may describe an image like this:

{
  "content_type": "image_asset_pointer",
  "asset_pointer": "file-service://file-A1b2C3d4E5f6",
  "metadata": {
    "dalle": {"gen_id": "aBcD3fGh1jKl"}
  }
}

Search the extracted archive for a filename containing file-A1b2C3d4E5f6. The file id after file-service:// is the useful join key; the gen_id is not.

The detailed matching procedure, including missing-asset cases, is in the conversation-export asset recovery guide.

An export is not guaranteed to resurrect every historical image. If the archive contains the pointer but no matching file, the bytes were not included and the pointer alone cannot recreate them.

Path 3: only the gen_id remains

There is no conversion step from gen_id to PNG, WebP, or a signed URL. If the original conversation and file are gone, regenerate from the prompt and any saved context.

Keep the failed identifier only as diagnostic metadata. Do not make it the primary key for an image in your own system. A safer record stores:

  • your prompt and generation settings;
  • the provider and model used;
  • the provider task id for support and tracing;
  • the final object key or URL in storage you control.

Path 4: you need automation

Use an API designed to return output files. With hiapi's async task API, the stable workflow is create, poll, download, and re-host:

curl -X POST https://api.hiapi.ai/v1/tasks \
  -H "Authorization: Bearer $HIAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2/text-to-image",
    "input": {
      "prompt": "a paper crane on a desk in soft morning light",
      "aspect_ratio": "1:1",
      "resolution": "1K"
    }
  }'

The create response contains a task id. Poll GET /v1/tasks/{taskId} until the task succeeds, then read data.output[0].url and its expireAt value.

curl -s "https://api.hiapi.ai/v1/tasks/$TASK_ID" \
  -H "Authorization: Bearer $HIAPI_API_KEY"

curl -s -o generated-image.webp "<data.output[0].url>"

The API output URL is also temporary. Its advantage is that it is an explicit part of the API contract and includes an expiry time. Download before expiry, verify the response, upload the bytes to your own storage, and persist that URL.

For model inputs and current pricing, use the gpt-image-2 model page and live pricing page. The task creation reference documents the request envelope.

A storage pattern that survives expiring links

For each successful task:

  1. Save the task id before polling so a worker retry does not create and bill a duplicate task.
  2. Download the output while output[0].url is valid.
  3. Reject HTML or JSON error bodies masquerading as an image; check status, content type, and file size.
  4. Upload the verified bytes to your bucket under your own object key.
  5. Store your object URL as the durable application URL and keep the temporary source URL only for short-lived diagnostics.

This pattern works whether the source is ChatGPT, hiapi, or another provider with signed output links.

FAQ

Is there an official gen_id download endpoint?

No. ChatGPT does not expose a public endpoint that accepts gen_id and returns the generated image. The identifier only has meaning in the original conversation context.

Can I build a backend-api URL from gen_id?

No. A working ChatGPT asset URL also depends on an internal file reference, session context, and a valid signature. Guessing the path does not produce those values.

Why does a ChatGPT image URL return 422?

The signed link is usually missing required query fields such as its timestamp or signature. Copying only the path, or using a tool that strips the query string, invalidates it.

Why does the same URL later return 404?

Signed URLs and underlying assets are temporary. Once the link or file expires, ResourceNotFound is expected and gen_id cannot restore it.

How do I create a permanent image URL?

Download the bytes while a valid source link exists, upload them to storage you control, and save your own URL. Permanence comes from your storage policy, not from the provider's pickup URL.

Latest models

View all models
  • GPT Image 2From $0.007/image
  • Nano Banana 2From $0.051/image
  • Seedream 5.0 ProFrom $0.050/image
  • Seedance 2.5From $0.121/s

Explore models

TextImageVideoAudio
Back to blog
GPT Image 2From $0.007/image
Nano Banana 2From $0.051/image
Seedream 5.0 ProFrom $0.050/image
Seedance 2.5From $0.121/s
View all models
TextChat and reasoning
ImageGenerate and edit
VideoText and image to video
AudioSpeech and music
Start generating
View model pricing
View all articles
Seedance 2.5 Text-to-Video: Build Short-Form Clips with the hiapi API

Seedance 2.5 Text-to-Video: Build Short-Form Clips with the hiapi API

Seedance 2.5 Reference-to-Video for Short-Form TikTok and Reels Clips

Seedance 2.5 Reference-to-Video for Short-Form TikTok and Reels Clips

Grok Imagine Image 2.0 Image-to-Image Prompts: 4 Recipes With Real Outputs

Grok Imagine Image 2.0 Image-to-Image Prompts: 4 Recipes With Real Outputs

Grok Imagine 2.0 Text-to-Image Prompt Recipes: Copy-Paste Prompts With Real Outputs

Grok Imagine 2.0 Text-to-Image Prompt Recipes: Copy-Paste Prompts With Real Outputs

Using flux-2-klein-9b/text-to-image for E-Commerce Product Images via the hiapi API

Using flux-2-klein-9b/text-to-image for E-Commerce Product Images via the hiapi API

Flux-2-Klein-9b Image-to-Image for E-Commerce Product Photos

Flux-2-Klein-9b Image-to-Image for E-Commerce Product Photos

Start generating