Skip to main content

GPT Image by Ace Data Cloud for LangChain

gpt-image integration icon

Install langchain-gpt-image-acedatacloud to give a LangChain application typed GPT Image by Ace Data Cloud tools. This is an Ace-provided integration, not an official client of the service brand. It does not install the other four service modules. 中文 · Privacy.

1. Install

Install PyPI langchain-gpt-image-acedatacloud==0.1.2. Official LangChain listing PR#6836 is merged and the public tools directory lists this Toolkit. The shared core dependency stays at 0.1.0; the other service packages are independently versioned.

python3 -m venv .venv
source .venv/bin/activate
python -m pip install langchain-gpt-image-acedatacloud==0.1.2

For source installation: git clone --branch main https://github.com/AceDataCloud/LangChain.git, cd LangChain, then pip install -e packages/core -e packages/gpt-image.

Get the application API Key

  1. Register or sign in → Applications. If no General application exists, choose Initialize General Application.
  2. Open the General application. Copy its API Key, or choose Manage Keys → Create to make a separately named LangChain key. Review expiration, usage limitations and Allowed APIs. Allow both the generation and same-ID task query paths used below. Confirm service access, balance and current pricing. No trial allowance is promised.
  3. Copy the raw token only, without Bearer , quotation marks or redacted characters. A platform-... account-management token cannot replace this application key.

Copy the redacted application API Key or open Manage Keys

Create a separately named key with optional restrictions

The credential name Dify tutorial in the historical create-key image is illustrative; name the actual key LangChain GPT Image. These are real Ace console screenshots reused from SunoDify, retrieved 2026-10-18; later console layouts may differ. They show credential setup, not a LangChain GUI. Real tokens are redacted.

export ACEDATACLOUD_API_TOKEN='your application key'

PowerShell: $env:ACEDATACLOUD_API_TOKEN='your application key'. Keep the token in the environment or secret manager, never in a prompt or workflow export.

2. Put the key in the client, not in model arguments

from langchain_acedatacloud import AceAPIClient
from langchain_gpt_image_acedatacloud import GPTImageToolkit

# No network requests: instantiate tools and inspect their names/schemas.
kit = GPTImageToolkit(client=AceAPIClient())
tools = kit.get_tools()  # Query-only by default.
print([tool.name for tool in tools])

There is no service-provider selection GUI in this package. Supply these LangChain BaseTool objects to your application or agent. Screenshots of another host's plugin authorization are not instructions for this Python integration.

3. First use, then query the same ID

After reviewing current service prices and deliberately authorizing one generation:

kit = GPTImageToolkit(client=AceAPIClient(), include_generation=True)
generate, retrieve = kit.get_tools()
# This line submits one paid generation if you choose to run it:
submitted = generate.invoke({"prompt": "A minimal watercolor sunrise over a lake."})
task_id = submitted["task_id"]
# Query the original ID; never call generate again just to wait:
result = retrieve.invoke({"task_id": task_id})
print(result["status"], result["terminal"], result["media_urls"])

gpt_image_generate_image submits one asynchronous request to /openai/images/generations. gpt_image_retrieve_task calls /openai/tasks with action=retrieve and the original id. A pending result is normal. Query that ID later until terminal=true; then inspect success/failure and final media URLs. The example shape is illustrative, not an actual paid result. Advanced edit/extend actions are not exposed in this initial toolkit.

Model and parameter coverage

Version 0.1.1 accepts all 24 model IDs and eight quality values in the reviewed public generation API, including DALL-E 2/3, GPT Image 2.6 variants and Nano Banana 2.1. Quality choices remain model-specific: DALL-E 2 accepts standard; DALL-E 3 accepts standard or hd and requires n=1. Unsupported explicit DALL-E values fail before submission.

For the five models already supported in 0.1.0 (gpt-image-1, gpt-image-1.5, gpt-image-2, gpt-image-2.5-flare, gpt-image-2.5-sunburst), absent quality and size retain the existing auto defaults. New models omit both fields unless supplied. Explicit None omits either field even for an older model. size="auto" requests prompt-based canvas selection; an omitted size uses the model's default canvas. Explicit supported values pass through unchanged. This package exposes generation and task lookup; image editing and GIF-specific parameters are not exposed.

The checked-in contracts/gpt-image.json owns the typed enum snapshot. Maintainers can explicitly refresh it with python scripts/sync_gpt_image_contract.py --refresh, review the diff, and run --check offline. Refreshing reads documentation and never generates an image.

Troubleshooting and cost

401: raw Key or token environment; 403: permissions, balance, expiry, Allowed APIs and response details; 429: reduce concurrency. For pending or a timeout, inspect the same task before any new submission. No automatic retries or hidden polling are performed. Usage History owns actual Credits. Avoid printing credentials or sending them to a model.

Metadata

Release files for langchain-gpt-image-acedatacloud 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-gpt-image-acedatacloud 0.1.2
File Size Uploaded Provenance Actions
langchain_gpt_image_acedatacloud-0.1.2.tar.gz 25.8 kB Without provenance Details for langchain_gpt_image_acedatacloud-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-gpt-image-acedatacloud 0.1.2
File Interpreter ABI Platform Actions
langchain_gpt_image_acedatacloud-0.1.2-py3-none-any.whl Python 3 none any Details for langchain_gpt_image_acedatacloud-0.1.2-py3-none-any.whl

Total release size: 32.5 kB

Release files / langchain_gpt_image_acedatacloud-0.1.2.tar.gz

Download URL langchain_gpt_image_acedatacloud-0.1.2.tar.gz
Size 25.8 kB
Tags Source
SHA-256 checksum
How to use checksums
16f906f2c494ba6e7b5125a97f7b96d51507c9f3ce980b6960151d3ed6fa743b
BLAKE2b-256 checksum
How to use checksums
5ed2db9583a943b04d40d9136fe1fdf2cc9532f87ccaa1488a83d4ede8760e76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / langchain_gpt_image_acedatacloud-0.1.2-py3-none-any.whl

Download URL langchain_gpt_image_acedatacloud-0.1.2-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b52a4674a346ed2f2a8fd492315c3033bc7a9304543a93ba27ddd40db1c69fab
BLAKE2b-256 checksum
How to use checksums
4448973ed227cce3bd7b130ce78e16cd9e457f0d5136bdfaab2fd944cad7ac9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for langchain-gpt-image-acedatacloud 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page