The Copilot API lets you apply prompt-based AI enhancements to individual photos
after the initial edit completes. This is the same capability as the AI Assistant
in the real estate web app. You send a natural-language instruction, and Imagen
returns an enhanced version of the image. Edits chain, so you can build on
previous results or reset to an earlier state.
Copilot is a general post-edit capability. Its endpoints sit on /v1/projects/
(no i2i prefix), so it works on top of any completed project regardless of how
it was edited.
Export the project first
The project must have reached Completed status, and you must call
export_project (Python) / exportProject (Node) on it
before any Copilot call — including apply_copilot and
get_ai_tools. Export prepares the edited versions Copilot builds on;
without it these calls fail. You only need to export once per project.
Endpoints
Method
Endpoint
Purpose
POST
/v1/projects/{uuid}/images/{filename}/copilot
Apply a prompt-based enhancement to one image
POST
/v1/projects/{uuid}/images/{filename}/enhance
Apply a preset enhancement to one image
GET
/v1/projects/{uuid}/ai-tools
List the AI enhancement (preset) tools available for the project
DELETE
/v1/projects/{uuid}/images/{filename}/copilot
Reset all Copilot edits on one image
POST
/v1/projects/{uuid}/finalize
Lock in Copilot edits and prepare the project for download
For the first call, set parent_version_id to null.
Copilot calls are synchronous
The endpoint waits for the enhancement to complete and returns the result
directly. No polling required.
curl -X POST 'https://api.imagen-ai.com/v1/projects/$PROJECT_UUID/images/DSC_0001.JPEG/copilot' \ --header 'x-api-key: $IMAGEN_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "instruction": "make the sky more blue", "parent_version_id": null, "project_source": "REGULAR" }'
# Export once before any Copilot call — required.await client.export_project(project_uuid)result = await client.apply_copilot( project_uuid, "DSC_0001.JPEG", "make the sky more blue",)version_id = result.version_id
// Export once before any Copilot call — required.await client.exportProject(projectUuid);const result = await client.applyCopilot( projectUuid, 'DSC_0001.JPEG', 'make the sky more blue');const { versionId, enhancedImageUrl } = result;
import imagen "github.com/imagenai/imagen-ai-sdk/sdks/go"// Export once before any Copilot call — required.if err := client.ExportAndWait(ctx, projectUUID, nil); err != nil { log.Fatal(err)}result, _ := client.Copilot(ctx, projectUUID, "DSC_0001.JPEG", imagen.CopilotRequest{ Instruction: "make the sky more blue", ProjectSource: imagen.ProjectSourceRegular,})fmt.Println("version:", result.VersionID)
Save the version_id. Pass it as parent_version_id on the next call to build on
this result.
2. Chain edits
Each prompt creates a new version that builds on the previous one. Pass the prior
version_id as parent_version_id. The response returns a new version_id such as 124. To branch from an earlier point, pass that earlier version_id
instead. Subsequent edits will overwrite the branch you didn’t keep.
using System.Net.Http;using System.Text;using System.Text.Json;using var client = new HttpClient();client.DefaultRequestHeaders.Add("x-api-key", Environment.GetEnvironmentVariable("IMAGEN_API_KEY"));var payload = JsonSerializer.Serialize(new { instruction = "brighten the interior", parent_version_id = 123, project_source = "REGULAR",});var content = new StringContent(payload, Encoding.UTF8, "application/json");var response = await client.PostAsync( $"https://api.imagen-ai.com/v1/projects/{projectUuid}/images/DSC_0001.JPEG/copilot", content);
Preset enhancement
POST .../images/{filename}/enhance applies a preset enhancement to a single
image instead of a free-text instruction. It mirrors the /copilot call shape
and also returns a new version. Use it when you want a fixed enhancement rather
than a prompt.
3. List available AI tools
List the AI enhancement (preset) tools available for this project — the same presets the /enhance endpoint applies.
# Export once before any Copilot call — required.await client.export_project(project_uuid)tools = await client.get_ai_tools(project_uuid)for t in tools.prompts: print(t.enhancement_type, t.label)
// Export once before any Copilot call — required.await client.exportProject(projectUuid);const tools = await client.getAiTools(projectUuid);for (const t of tools.prompts) { console.log(t.enhancementType, t.label);}
import imagen "github.com/imagenai/imagen-ai-sdk/sdks/go"// Export once before any Copilot call — required.if err := client.ExportAndWait(ctx, projectUUID, nil); err != nil { log.Fatal(err)}tools, _ := client.GetAITools(ctx, projectUUID, imagen.ProjectSourceRegular)for _, t := range tools.Prompts { fmt.Println(t.EnhancementType, t.Label)}
using System.Net.Http;using var client = new HttpClient();client.DefaultRequestHeaders.Add("x-api-key", Environment.GetEnvironmentVariable("IMAGEN_API_KEY"));var response = await client.DeleteAsync( $"https://api.imagen-ai.com/v1/projects/{projectUuid}/images/DSC_0001.JPEG/copilot");
5. Finalize
Once you’re satisfied with all Copilot edits across the project, call /finalize
to lock them in and prepare the output for download.
POST/v1/projects/PROJECT_UUID/finalize
curl -X POST 'https://api.imagen-ai.com/v1/projects/$PROJECT_UUID/finalize' \ --header 'x-api-key: $IMAGEN_API_KEY'
result = await client.finalize_project(project_uuid)for f in result.files_list: print(f.file_name, f.download_link)
const links = await client.finalizeProject(projectUuid);// links is an array of final (upscaled) download URLs
import imagen "github.com/imagenai/imagen-ai-sdk/sdks/go"result, _ := client.Finalize(ctx, projectUUID, imagen.ProjectSourceRegular)for _, f := range result.FilesList { fmt.Println(f.FileName, f.DownloadLink)}
using System.Net.Http;using var client = new HttpClient();client.DefaultRequestHeaders.Add("x-api-key", Environment.GetEnvironmentVariable("IMAGEN_API_KEY"));var response = await client.PostAsync( $"https://api.imagen-ai.com/v1/projects/{projectUuid}/finalize", null);
After finalizing, use the same download endpoint as your editing mode to retrieve
the output files. Use Quickstart for profile-based projects, or
Smart Editing for I2I projects.
Human revision is not yet in the API
Requesting an Imagen expert to review and re-edit a photo is available in the
web app but is not yet supported via the API.