
Configure an Imagild client with https://imagild.com/api/relay/v1 as its API base and append routes such as /models or /images/generations exactly once. Do not use the website's /en/model-api page as an endpoint, and do not append a second /api/relay/v1 to an already complete base. The API console shows the connection address.
Key Takeaways
- A complete base plus one relative route produces the request URL; locale prefixes belong to website pages.
- A familiar model ID does not make Imagild's asynchronous JSON contract interchangeable with another SDK.
- Check status, Content-Type, and response shape before interpreting an HTML response as a model failure.
Separate three addresses in configuration
A useful application configuration distinguishes the public website, the API prefix, and a particular task resource.
| Address | Intended use |
|---|---|
https://imagild.com/en/model-api | Read the console and integration guide in a browser |
https://imagild.com/api/relay/v1 | Configure the media API base |
https://imagild.com/api/relay/v1/models | Read the authenticated model catalog |
https://imagild.com/api/relay/v1/tasks/UUID/content | Download an owned successful task with authentication |
Keep these as named concepts rather than one variable called “URL.” A frontend link may correctly open the console while the backend needs the API base. Reusing the page link inside curl can return a valid HTML document that is useless as a model response.
The route for generating an image is /images/generations; generating video uses /videos/generations. Neither belongs under /en/ or /zh-CN/.
Choose one joining convention
For a shell client, remove trailing slashes from the configured base and include one leading slash on the route:
BASE='https://imagild.com/api/relay/v1'
BASE="${BASE%/}"
curl --silent --show-error --dump-header response.headers \
--output response.body --write-out '%{http_code}\n' \
"$BASE/models" \
-H "Authorization: Bearer $IMAGILD_API_KEY"
If a client library instead treats its base as an origin and expects complete paths, configure the origin https://imagild.com and provide /api/relay/v1/models once. Do not combine both conventions. Test the final resolved URL in your application's own unit test, without embedding a real key in the test fixture.
For example, a configuration review should reject /api/relay/v1/api/relay/v1/models and /en/model-api/models. This check can happen before any network request.
Inspect the response before parsing it
A successful catalog response has JSON with data.models. A successful generation submission returns HTTP 202 and a task object containing data.id; it does not immediately return image bytes. Downloaded task content is a different resource.
If JSON parsing encounters an opening <, preserve a small sanitized diagnostic rather than dumping the whole response into a public issue. Check:
- The final request address and method.
- The status code and response Content-Type.
- Whether the body is a website page, access error, or expected API JSON.
- Any proxy rewrite that removed or duplicated the API prefix.
The downloaded-HTML diagnostic explains the same distinction for a saved file. A renamed extension cannot turn a page into an image.
Keep authentication independent of URL construction
Pass the key in Authorization: Bearer ..., not in a query string or a copied page link. OWASP's REST security guidance specifically warns against putting sensitive values in URLs, where intermediary logs can record them.
A correct URL can still return 401 for an invalid key or a membership-related 403. Those are different from route construction mistakes. Confirm active membership in the console and use the model hub to review supported choices and the 1K/2K/4K point schedule.
Finally, leave supplier hostnames out of your client configuration. Your application targets Imagild's published gateway contract. An upstream vendor's endpoint or SDK can have a different response lifecycle, authentication scheme, or parameter list. Once catalog access works, preserve the same verified base when adding task polling and authenticated downloads.
Related tasks
- Why Does My Downloaded Image Open as a Web Page?
- Why Does My Download Button Open the Photo in a New Browser Page Instead of Saving It?
Sources and scope
- Imagild API console and integration guide: Product entry point and current API access, credential and task integration instructions; detailed facts also cross-checked against the 2026-10-28 repository contract.
- Imagild model hub: Current public media model choices and resolution-based point prices; not evidence of model equivalence, pixel quality or measured uptime.
- OWASP REST Security Cheat Sheet: General REST security principles: endpoint authorization, secure handling of credentials, input validation and response content-type checks. Does not define Imagild product behavior.
Product instructions were checked against the current Imagild API contract and the public model catalog. Code, budgets and acceptance checks are illustrative; this article does not claim a new paid generation test, an uptime measurement, a search-volume study or a ranking of AI citations.
Prepared by Imagild Editorial, the company editorial team responsible for these guides. AI assisted research and drafting. This is documentation-based guidance with proposed examples, not a claim of hands-on testing or an independent product review. Report a correction.
Cover: Original Imagild product screenshot captured on 28 October 2026; model availability and prices may change. This image is not an API response or a performance benchmark.