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 Omni

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 Background Remover
  • 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
  • Download from a working ChatGPT image link
  • Why ChatGPT image links expire
  • Recover an image from a complete ChatGPT data export
  • 1. Extract the entire archive
  • 2. Find the image pointer
  • 3. Extract the file id
  • 4. Search the exported files
  • 5. Verify and re-host the file
  • When only the gen_id remains
  • Build an automated download workflow
  • A storage pattern that survives expiring links
  • FAQ
  • How do I download an image from a ChatGPT link?
  • Is there an official gen_id download endpoint?
  • Why does a ChatGPT image URL return 422?
  • Why does the same image URL later return 404?
  • How do I recover a file-service:// image from an export?
  • How do I create a permanent image URL?
Back to blog
GuideJul 21, 2026

How to Download a ChatGPT Image from a Link, Export, or gen_id

Use the recovery path that matches a working ChatGPT link, a complete data export, an expired URL, or only a gen_id.

hiapiUpdated Aug 27, 2026troubleshootingchatgpt-exportgpt-image-2tasks-api

Latest models

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

Explore models

TextChat and reasoningImageGenerate and editVideoText and image to videoAudioSpeech and music
Contents
  • Download from a working ChatGPT image link
  • Why ChatGPT image links expire
  • Recover an image from a complete ChatGPT data export
  • 1. Extract the entire archive
  • 2. Find the image pointer
  • 3. Extract the file id
  • 4. Search the exported files
  • 5. Verify and re-host the file
  • When only the gen_id remains
  • Build an automated download workflow
  • A storage pattern that survives expiring links
  • FAQ
  • How do I download an image from a ChatGPT link?
  • Is there an official gen_id download endpoint?
  • Why does a ChatGPT image URL return 422?
  • Why does the same image URL later return 404?
  • How do I recover a file-service:// image from an export?
  • How do I create a permanent image URL?

If you need to download a ChatGPT image from a link, save the file while the link still opens. ChatGPT image URLs are temporary, and a gen_id cannot turn an expired link back into image bytes.

Use the recovery path that matches what you still have:

What you still haveBest recovery pathExpected result
A working ChatGPT image link or the original conversationOpen the image, download the bytes, then re-host the fileThe original image can usually be preserved
A complete ChatGPT export with conversations.json and asset filesMatch the file-service:// pointer to an exported fileThe image can be recovered if its bytes are in the archive
An expired backend-api or oaiusercontent linkReturn to the original chat, check a complete export, or regenerateEditing the old URL will not renew it
Only a gen_idRecreate the image from the prompt or saved contextThe original pixels cannot be retrieved from the id
A repeatable automated workflowGenerate through a documented API, download the output, and store your own URLFuture files are kept under your control

The important distinction is between a link that still authorizes a download and identifiers that only describe the conversation. A working signed link can deliver bytes. A gen_id cannot.

Download from a working ChatGPT image link

If the original conversation still exists, open the generated image and use ChatGPT's download control. If you copied the image link instead, open the complete link without removing its query string and save the response immediately.

Before treating the download as successful, verify that the response:

  • returns HTTP 200;
  • has an image content type such as image/png or image/webp;
  • has a plausible file size; and
  • opens as the expected image.

A link that works only in your current browser is not a durable application URL. The browser may still have the right session or a fresh signature. Download the bytes and upload them to storage you control instead of publishing the ChatGPT link.

Why ChatGPT image links expire

ChatGPT may store several references around one generated image:

  • gen_id identifies a generation inside a conversation.
  • 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.

These references serve different internal jobs. None is a permanent public file URL.

A copied link can fail in two common ways:

HTTP 422
missing query fields such as p or ts

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

HTTP 404
ResourceNotFound

The signature or underlying asset has expired, the file was deleted, or the request no longer has the context that issued the link. Reconstructing a plausible path from gen_id does not restore the signature or the image.

Recover an image from 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",
  "size_bytes": 1417238,
  "width": 1024,
  "height": 1024,
  "metadata": {
    "dalle": {"gen_id": "aBcD3fGh1jKl"}
  }
}

The file-... value after file-service:// is the useful join key. The gen_id is not a filename or download credential.

1. Extract the entire archive

Keep the directory structure intact. Opening only conversations.json removes the asset files needed for the other half of the match.

2. Find the image pointer

Search conversations.json for "content_type": "image_asset_pointer", locate the conversation and image you need, and copy the full asset_pointer value.

3. Extract the file id

Remove only the internal scheme:

file-service://file-A1b2C3d4E5f6
               └─ file-A1b2C3d4E5f6

Do not replace file-service:// with https:// or try to curl it. It is an internal URI scheme, not a public host.

4. Search the exported files

On macOS or Linux:

find . -type f -iname '*file-A1b2C3d4E5f6*'

If the archive renamed or nested assets differently, search for the distinctive id segment. Compare candidate files with size_bytes, width, and height when those fields are available.

5. Verify and re-host the file

Open the candidate locally and confirm it is the expected image. Copy the verified bytes to your own S3, R2, CDN, or application storage and record that durable URL.

For many pointers, this local script lists the unique asset ids in an export without contacting ChatGPT:

import json
from pathlib import Path

data = json.loads(Path("conversations.json").read_text())
seen = set()

def walk(value):
    if isinstance(value, dict):
        if value.get("content_type") == "image_asset_pointer":
            pointer = value.get("asset_pointer", "")
            if pointer.startswith("file-service://"):
                seen.add(pointer.removeprefix("file-service://"))
        for child in value.values():
            walk(child)
    elif isinstance(value, list):
        for child in value:
            walk(child)

walk(data)
for file_id in sorted(seen):
    print(file_id)

A pointer proves that the conversation once referred to an asset. It does not guarantee that the export contains the bytes. If the fully extracted archive has no matching file, neither file-service:// nor gen_id can reconstruct the original pixels.

When only the gen_id remains

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

Keep the failed identifier only as diagnostic metadata. For images your application must retain, store:

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

Build an automated download workflow

Use an API designed to return output files. With hiapi's async task API, the stable workflow is create, poll, download, verify, 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"
    }
  }'

Poll GET /v1/tasks/{taskId} until the task succeeds, then read data.output[0].url and expireAt:

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, but its expiry is part of the documented contract. Download it before expiry, reject HTML or JSON error bodies, and upload the verified bytes to your own storage.

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 its signed URL is valid.
  3. Check status, content type, and file size before accepting the response as an image.
  4. Upload the verified bytes under an object key you control.
  5. Persist your object URL and keep the temporary source URL only for short-lived diagnostics.

FAQ

How do I download an image from a ChatGPT link?

Open the complete link while it still works, keep its signed query parameters, download the image bytes, and re-host the file. A link that opens only in your logged-in browser should be treated as temporary.

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 its original conversation context.

Why does a ChatGPT image URL return 422?

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

Why does the same image URL later return 404?

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

How do I recover a file-service:// image from an export?

Copy the file id after file-service:// and search the fully extracted archive for a filename containing that id. Use file size and dimensions as secondary checks.

How do I create a permanent image URL?

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

Latest models

Explore models

Generate it with HiAPI

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

Start generatingView model pricing

HiAPI Blog

Related articles

View all articles
Using gpt-6-astra for e-commerce product images via the hiapi API

Using gpt-6-astra for e-commerce product images via the hiapi API

Recraft Background Removal for E-Commerce Product Images

Recraft Background Removal for E-Commerce Product Images

Turn a Script into a Talking-Head Short with heygen-avatar-v and hiapi's API

Turn a Script into a Talking-Head Short with heygen-avatar-v and hiapi's API

heygen-avatar-v Prompt Recipes: Copy-Paste Prompts With Real Outputs

heygen-avatar-v Prompt Recipes: Copy-Paste Prompts With Real Outputs

Veo 3.1 Lite Image-to-Video: Turn Photos Into Short-Form Video via the hiapi API

Veo 3.1 Lite Image-to-Video: Turn Photos Into Short-Form Video via the hiapi API

Qwen Image 3.0 Image-to-Image: Turn One Product Photo Into a Full E-Commerce Set

Qwen Image 3.0 Image-to-Image: Turn One Product Photo Into a Full E-Commerce Set

HiAPI

Generate it with HiAPI

Start generating
View all models
GPT Image 2From $0.030/image
Nano Banana 2From $0.051/image
Seedream 5.0 ProFrom $0.050/image
Seedance 2.5From $0.231/s
Text
Image
Video
Audio