# GPT Image 2 HD on TokPort > A GPT Image 2 variant that renders up to 2048 × 2048, for text-to-image and reference-image edits. - Model id: gpt-image-2-hd - Modality: image - Price: $0.035 per image - Base URL: https://api.tokport.io - Auth: Authorization: Bearer (create one at https://tokport.io/dashboard/keys) - OpenAPI: https://tokport.io/api/openapi?model=gpt-image-2-hd - Human docs: https://tokport.io/models/gpt-image-2-hd/api ## Text to image — POST /v1/images/generations Parameters: - model (string, required): "gpt-image-2-hd" - prompt (text, required): What to generate. Be concrete about subject, style, lighting and composition. - size (enum): Output size as "WIDTHxHEIGHT" pixels. [one of 1024x1024 | 2048x2048; default 1024x1024] - n (integer): Number of images to generate in one request. Each image is billed. [default 1; range 1-4] - response_format (enum): Return hosted URLs (expire after a while) or inline base64 PNG data. [one of url | b64_json; default url] Example: ```bash curl https://api.tokport.io/v1/images/generations \ -H "Authorization: Bearer $TOKPORT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-image-2-hd","prompt":"a neon koi swimming through clouds, cinematic lighting","size":"1024x1024","n":1}' ``` Response: Synchronous. `data[]` holds one entry per generated image with `url` (or `b64_json` when requested). The `X-Oneapi-Request-Id` response header identifies the request in your usage log. ```json { "created": 1726400000, "data": [ { "url": "https://cdn.example.com/generated/abc.png", "revised_prompt": "a neon koi swimming through clouds, cinematic lighting" } ] } ``` ## Image to image — POST /v1/images/edits Parameters: - model (string, required): "gpt-image-2-hd" - image (image, required): Reference image as a public URL or a data: URL (PNG, JPEG or WebP, up to 8 MB). - prompt (text, required): How the reference image should change. The model keeps what you do not mention. - size (enum): Output size as "WIDTHxHEIGHT" pixels. [one of 1024x1024 | 2048x2048; default 1024x1024] - n (integer): Number of images to generate in one request. Each image is billed. [default 1; range 1-4] - response_format (enum): Return hosted URLs (expire after a while) or inline base64 PNG data. [one of url | b64_json; default url] Example: ```bash curl https://api.tokport.io/v1/images/edits \ -H "Authorization: Bearer $TOKPORT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-image-2-hd","image":"https://example.com/reference.png","prompt":"put the product on a marble pedestal with soft studio lighting","size":"1024x1024","n":1}' ``` Response: Synchronous. `data[]` holds one entry per generated image with `url` (or `b64_json` when requested). The `X-Oneapi-Request-Id` response header identifies the request in your usage log. ```json { "created": 1726400000, "data": [ { "url": "https://cdn.example.com/generated/abc.png", "revised_prompt": "a neon koi swimming through clouds, cinematic lighting" } ] } ```