Image generation
Send a prompt and optional reference files to Atlas, then retrieve a new PNG at the exact path you requested. Atlas uses its saved provider connection and keeps its current folder, selection, and generation draft unchanged.
Start with for HTTP authentication or MCP setup. All commands below use POST /ai/v1/command. With MCP, use atlas_query for discovery and job lookup, and atlas_act to start work or retry output processing.
Discover models and settings
{
"command": "generation_options",
"args": {}
}Build your model picker from this response each time you open the controls. Atlas returns its local catalog and saved connection state without waiting for provider credit checks. Models from disconnected providers are excluded. Atlas refreshes provider catalogs in the background and checks the selected model again when a request starts.
schemaVersionThe discovery response version, currently 1.providersProvider rows with id, name, and connected. A saved connection does not prove that a session is still valid or has enough credits.modelsThe available model descriptors. Use providerId and id together as the model key. Read operations to choose a model that supports generation or editing. Display name as the label.models[].controlsBuild resolution choices from resolution.values. For aspect ratio, read aspectRatio.presets, allowCustom, matchReference, maximumRatio, and optional sizeConstraints. Optional quality.values contain { value, label } rows. Optional background contains the allowed background values. Hide controls absent from the descriptor.models[].referencesRead maximum, maximumBytesEach, and optional roles before attaching references. These are model limits and can be lower than the request schema's limits.models[].expectedDurationMsAn estimate for the selected model's wait time. It is not a completion deadline.refreshing, updatedAt, retryAfterMsA cold start can return an empty list with refreshing: true and updatedAt: null. Retry discovery after retryAfterMs, usually 1000 ms. Keep showing the last list while an update is in progress.postProcessingCleanup rows with id and ready. Show only supported cleanup operations. Their local models load or download when a job invokes them.Send a generation request
Create a request ID once and keep it with the target panel in your editor. Choose a model from discovery. References use absolute paths on the computer running Atlas. Atlas snapshots those files before submitting the job.
{
"command": "start_generation",
"args": {
"requestId": "editor-panel-42-attempt-1",
"providerId": "<providerId from discovery>",
"modelId": "<model id from discovery>",
"prompt": "Keep the layout and replace the cloudy sky with a clear sky.",
"references": [{ "path": "C:/Artwork/panel-42.png" }],
"output": {
"folder": "C:/Artwork/generated",
"fileName": "panel-42-clear-sky.png",
"size": "match",
"fit": "contain",
"fields": [{
"source": "editor.panel-id",
"label": "Panel ID",
"value": "42"
}]
}
}
}The paths above are examples. Use the user's actual paths, including native absolute paths on macOS or Linux. To generate without a reference, omit references and use output.size: "provider" or explicit dimensions. match needs a first reference.
requestIdRequired. Caller-created retry key. Reuse the same key and arguments after a lost reply. Never reuse it for a different request. Type: string. Maximum length: 160.providerIdRequired. Type: string. Maximum length: 100.modelIdRequired. Type: string. Maximum length: 100.promptRequired. Type: string. Maximum length: 16000.referencesOptional. No references means generate; one or more means edit. The chosen model may have lower limits. Type: array. Default: []. Maximum entries: 14.optionsOptional. Use only values from the chosen model's controls in generation_options. Unsupported values are rejected before generation. Type: object. Default: {}.postProcessingOptional. Atlas always applies JPEG cleanup before background removal. Required models download only when this job invokes them. Type: array. Values: remove-jpeg-artifacts, remove-background. Default: []. Maximum entries: 2.outputRequired. Type: object.Each reference uses the following fields. Its file must be PNG, JPEG, or WebP, regardless of whether it is indexed by Atlas.
pathRequired. Absolute path to PNG, JPEG, or WebP. Atlas snapshots the file before submitting. Type: string. Maximum length: 4096.labelOptional. Type: string. Maximum length: 160.roleOptional. Values: reference, style, character. Default: "reference".Set output size and cleanup
options controls the provider request. output controls the finished file. For example, choose a model's generation resolution through options.resolution and request the original panel's exact dimensions through output.size: "match". Atlas fits the generated result to those dimensions after generation.
folderRequired. Absolute destination directory. Atlas creates it if needed, without registering it or changing the current folder. Type: string. Maximum length: 4096.fileNameRequired. Exact PNG file name. Path separators, reserved device names, and existing files are rejected. Atlas never overwrites an output. Type: string. Maximum length: 180.sizeOptional. provider preserves provider dimensions. match uses the first reference's oriented pixel dimensions. An object requests exact final dimensions, up to 40 million pixels. Default: "provider".fitOptional. contain pads with transparency; cover crops at the center; fill stretches. Applies only to final size. Values: contain, cover, fill. Default: "contain".fieldsOptional. Merge into the generated PNG's Atlas fields by source identifier. This does not change library tags or the reference image's metadata. Type: array. Default: []. Maximum entries: 256.For explicit dimensions, use output.size: { width: 1600, height: 900 }. The file always uses PNG. contain preserves the full image and adds transparent padding. cover crops at the center. fill stretches the image.
The output folder can be outside every Atlas project. Atlas creates it if needed. It never changes or replaces the reference file. If the exact output name already exists, the request fails instead of overwriting it.
{
"postProcessing": [
"remove-jpeg-artifacts",
"remove-background"
]
}Atlas always applies JPEG cleanup before background removal. Required models download only when this job invokes them.
Write metadata fields
Merge into the generated PNG's Atlas fields by source identifier. This does not change library tags or the reference image's metadata. Use a stable source value for each field your tool owns. Atlas preserves other named fields in the generated PNG. Writing these fields does not add the file to an Atlas project.
sourceRequired. Stable field identifier. Matching identifiers update existing fields; other fields are preserved. Maximum 160 UTF-8 bytes. Type: string. Maximum length: 160.labelRequired. Maximum 160 UTF-8 bytes. Type: string. Maximum length: 160.valueRequired. Maximum 256 KiB in UTF-8. Type: string. Maximum length: 262144.iconIdOptional. Type: string. Maximum length: 80.showInSidebarOptional. Type: boolean. Default: true.Read results and recover a request
Starting returns a job receipt before generation completes. Keep your editor usable while the job runs. Query the receipt with exactly one of jobId or the original requestId. When it completes, read outputPath and put that file into the panel saved with the request ID.
{
"command": "get_generation",
"args": {
"requestId": "editor-panel-42-attempt-1"
}
}statusValues: running, completed, failed, interrupted. Only completed means the finished output is ready.stageValues: generating, processing, saving, completed. Use this to show what Atlas is doing while status is running.outputPath, width, heightThe saved file path and final pixel dimensions on completion. These can be null before the result is ready.errorThe failure message, or null when there is no error.canRetryOutputWhen true, Atlas retained the generated original and can retry cleanup and saving without calling the provider again.- If a start reply is lost, resend the same request ID and arguments. Atlas returns the same receipt. Reusing the ID with different arguments is rejected.
- If cleanup or saving fails and
canRetryOutputis true, callretry_generation_outputwith the same lookup arguments. Resolve the local problem first, for example an unwritable folder. This retry does not submit another paid generation. - If Atlas stops during generation, the request can become
interrupted. Atlas does not resend it automatically. The provider may already have processed or charged for it. - Atlas permits up to four external jobs at once, shared with the older image-edit commands. If a start is rejected because the limit is full, wait for an active job to finish.
Request schema and compatibility
Fetch generation_schema to get the request schema from the running Atlas version. The download below is the website's copy. Atlas owns the source, and the website build checks that its copy matches. Field lists on this page derive from that same file.
The schema's $defs.job describes a job receipt. The older start_image_edit and get_image_edit commands remain available for existing clients. Use start_generation and get_generation for new tools.