If you are turning CometAPI’s GPT Image 2.5 quickstart into a browser prototype, keep the browser’s contract smaller than the provider’s contract. Let the browser send an application prompt to your server; let the server choose the approved model and upstream route.
What the CometAPI example establishes
The official CometAPI Flare page shows a request to https://api.cometapi.com/v1/images/generations with the model ID gpt-image-2.5-flare and a prompt. Its Python and JavaScript examples use an environment-provided COMETAPI_KEY, the same base URL, and images.generate. The examples print or log the response. They do not, by themselves, establish whether your application will receive an image URL, base64 data, or another representation.
The paired Sunburst quickstart uses the same CometAPI base URL and generation method with gpt-image-2.5-sunburst. Treat those exact IDs as provider-facing values, not as arbitrary browser input.
A proposed boundary
- Browser: collect and validate the product’s prompt fields, then
POSTonly the application-level prompt to your own server. - Server: authenticate the user as appropriate for your application, apply length and content rules, select one model from a fixed allowlist (
gpt-image-2.5-flareorgpt-image-2.5-sunburst), and call CometAPI’s/v1/images/generationsroute. - Server: inspect the returned response according to the representation your implementation has actually verified. Only then map it to the browser’s image-only response shape.
A redacted server-side request can therefore look like:
{
"model": "gpt-image-2.5-flare",
"prompt": "<validated application prompt>"
}
Keep COMETAPI_KEY in the server environment; never place it in a browser bundle. Do not accept an upstream URL or arbitrary model string from the browser. Those controls are proposed application design, not claims that this adapter has been deployed or tested.
Make the handoff explicit
Define your own response contract only after checking the actual response returned by your CometAPI integration. For example, an image-only handoff might eventually be:
{ "image": "<verified image representation>" }
That placeholder is intentional: the captured quickstart logs the response but does not demonstrate decoding or saving. Add the decoder, storage policy, error mapping, and size limits as separate implementation decisions, and test them against the representation you observe. This narrow boundary keeps CometAPI’s documented endpoint and model IDs stable while preventing provider-specific details from leaking into the browser.