How to Generate SVG Logos and Icons with GPT Image 2.6
To generate an SVG logo or icon with GPT Image 2.6, send a prompt to POST /v1/images/generations with output_format set to svg and n set to 1. Decode data[0].b64_json and save the bytes as a .svg file. Flare and Sunburst both support this workflow. OpenAI image generation guide
The result is a static vector graphic whose shapes and colors you can inspect in a vector editor. Start with a simple mark, check it at the size you will use, and refine the lettering or paths before publishing.
What GPT Image 2.6 Returns as an SVG
The API creates a reference picture, then uses that picture to author the SVG. Quality controls the reference image. The documented output contains static vector content, with no scripts, external resources, or embedded raster images. OpenAI image generation guide
For a first icon, try a clear silhouette and a small palette. For a wordmark, check every letter after generation. Raising the quality setting is an option to compare when the reference needs more detail, but the finished lettering still needs review.
SVG generation is billed for the reference image and the tokens used to author the SVG. The total depends on both stages. The complexity setting controls planning for the reference image, separately from SVG authoring. Both image models default to high complexity when you omit it. For a simple mark, low is a starting point to test. OpenAI Image API guide
Use Flare to explore directions quickly and compare Sunburst for more detailed work. When you need to preserve an existing outline exactly, edit the saved SVG directly in a vector editor.
Generate and Download an SVG with the API
Install or update the Python SDK with pip install -U openai. Set OPENAI_API_KEY in the environment where you run the code. For a website, keep the key on your server. This example requests a North Lamp logo and saves the decoded SVG.
import base64
from pathlib import Path
from openai import OpenAI
client = OpenAI()
result = client.images.generate(
model="gpt-image-2.6-flare",
prompt=(
'One SVG logo for a lamp workshop called "North Lamp". '
"A lamp built from three flat shapes sits left of the name. "
"Use black shapes with wide empty margins. "
"Keep the canvas empty around the mark. "
"No texture, shadows, room, or mockup."
),
n=1,
size="1024x1024",
quality="medium",
complexity="low",
output_format="svg",
)
svg_bytes = base64.b64decode(result.data[0].b64_json)
Path("north-lamp.svg").write_bytes(svg_bytes)
Use n=1 and omit streaming, partial images, and output compression for SVG. The response field contains Base64, so decode it before saving. Writing the decoded bytes preserves the returned UTF-8 XML. OpenAI image generation guide
Open north-lamp.svg in a browser and a vector editor. If the lettering is wrong, adjust it in the editor or request a new candidate. For a brand name that needs exact typography, generate the symbol separately and set the wordmark yourself.
Prompts for SVG Logos and Icons
Describe the mark you want to deliver. Include the subject, palette, padding, and exact words when needed. A scene description can pull the design toward an illustration, so make the logo or icon the main subject.
Logo with a wordmark
One SVG logo for a lamp workshop called "North Lamp". A simple lamp built from three flat shapes sits to the left of the name. Use black shapes and lettering with wide empty margins. Leave the canvas empty around the design. No texture, shadows, room, or mockup.
Read the name at website header size. Check the spacing between the symbol and the letters, especially if you will place it beside navigation links.
Logo symbol without lettering
One SVG logo mark of a wheat sprig inside a circle for a bakery. Use two flat colors, black and gold. Keep the silhouette simple and leave a wide empty margin. No lettering, bread, table, photograph, or mockup.
Use this approach when you plan to add the business name separately. Check the gaps between the wheat shapes at the smallest size you need.
Solid icon
One SVG icon of a paper plane as a single solid silhouette. Center it in a square canvas with even padding. Use one color and clear negative space. No text, clouds, gradients, or shadows.
Outline icon
One SVG icon of an open book, drawn with thick, even strokes and rounded line ends. Center it in a square canvas with equal padding. Use one color. No page texture, lettering, or shading.
For a set, keep the same padding, stroke weight, and corner treatment in each prompt. Compare all icons at their intended display size, such as 24 pixels for a toolbar. Adjust their visual weight and alignment in your editor.
Check the SVG Before You Publish
Review the actual file you will ship. A screenshot shows how it looks at one size, while the SVG lets you inspect the shapes behind that appearance.
- Parse the XML and check that its root element is
svgin the SVG namespace. An XML declaration or comment can appear before the root element. - Inspect the shapes in a vector editor. Select a path or shape and change its fill or stroke to check that you can make the edits your project needs.
- Check for embedded image elements and external references. If the file contains unexpected raster content, investigate the export or generation workflow.
- Preview at the intended size and on light and dark backgrounds. Check for a full-canvas background shape, low contrast, and details that disappear.
- Read every letter and inspect the curves. Fix spacing, stray shapes, uneven strokes, and cutouts before adding the asset to your website.
Zooming in is useful for reviewing edges, but it does not establish the file structure. Use the vector editor or XML inspection to verify how the artwork is built.
Frequently Asked Questions
Can I ask ChatGPT instead of using the API?
You can use ChatGPT to develop a logo concept. For the explicit output_format=svg workflow covered here, use the Image API. Check the file you receive before treating any preview or download as editable vector artwork.
Why did I get a normal image?
Check that the request used output_format=svg and inspect the decoded response. The filename alone does not determine the format. If the saved file contains PNG bytes, check the submitted parameters and the output returned by your provider.
Can I edit an SVG with the image edit endpoint?
Use a vector editor for path changes. OpenAI’s generation guide says the image edit endpoint does not support SVG output, while the edit reference lists SVG subject to model and project access. Use the generation endpoint for this tutorial and check current support before building an edit workflow. OpenAI generation guide Image edit reference
Which model should I use?
Start with Flare for quick exploration and compare Sunburst when you need more detail. Keep the saved SVG for precise revisions to its existing geometry.
Does gptimages26.com return this SVG file?
Flare and Sunburst on gptimages26.com can return an SVG. Economy does not. The request above is the OpenAI images API, which is separate from the box on this site.