Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented May 7, 2025

Summary by CodeRabbit

  • Documentation

    • Enhanced API documentation with new example requests, responses, and code samples in curl, Python, and TypeScript for several endpoints.
    • Marked certain endpoints as "(legacy)" in their summaries for clearer distinction.
  • New Features

    • Added a new style type option, "CUSTOM", for image generation.
  • Bug Fixes

    • Updated default style type for image generation models version 3 and above to "GENERAL".
  • Refactor

    • Removed the "style_ref_embeddings" option from image generation requests.

@coderabbitai
Copy link

coderabbitai bot commented May 7, 2025

Walkthrough

The OpenAPI specification for the Ideogram API was updated to enhance documentation and examples. Several legacy endpoints were marked as such in their summaries. Rich example requests, responses, and code samples were added for multiple endpoints. Schema changes include removal of a property, an enum value addition, and a default value update.

Changes

File(s) Change Summary
src/libs/Ideogram/openapi.yaml Appended "(legacy)" to summaries of /edit, /generate, /reframe, /remix endpoints; added x-fern-examples with request/response/code samples for /describe, /upscale, and all /v1/ideogram-v3/* endpoints; removed style_ref_embeddings from GenerateImageRequest; added CUSTOM to StyleType enum; changed default of StyleTypeV3 enum from AUTO to GENERAL.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant API

    Note over Client,API: Example flow for /v1/ideogram-v3/generate endpoint

    Client->>API: POST /v1/ideogram-v3/generate (with prompt, style_type, etc.)
    API-->>Client: JSON response with generated image data
Loading

Poem

A hop and a skip through the OpenAPI field,
New examples and enums, the docs now revealed.
"Legacy" marked, so old paths are clear,
Style types expanded, new options appear.
With code samples for all,
This rabbit stands tall—
Hooray for the docs, let’s answer the call! 🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot enabled auto-merge May 7, 2025 01:48
@github-actions github-actions bot merged commit 3190fd0 into main May 7, 2025
3 of 4 checks passed
@github-actions github-actions bot deleted the bot/update-openapi_202505070147 branch May 7, 2025 01:49
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Update OpenAPI spec with enhanced docs, examples, and schema changes May 7, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
src/libs/Ideogram/openapi.yaml (1)

39-42: Inconsistent x-fern-examples structure for /describe
The new x-fern-examples block for /describe includes only code samples. It would improve clarity and consistency if you also provide explicit request and response examples (as seen in other endpoints), so users can see complete input and output schemas.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69507eb and b92c79a.

⛔ Files ignored due to path filters (19)
  • src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostEditImage.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImage.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostGenerateImageV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostReframeImage.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImage.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.GenerateClient.PostRemixImageV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostEditImage.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImage.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostGenerateImageV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostReframeImage.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImage.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.IGenerateClient.PostRemixImageV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequest.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.GenerateImageRequestV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.ImageGenerationObjectV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.RemixImageRequestV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.StyleType.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/Ideogram.Models.StyleTypeV3.g.cs is excluded by !**/generated/**
  • src/libs/Ideogram/Generated/JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/Ideogram/openapi.yaml (12 hunks)
🔇 Additional comments (8)
src/libs/Ideogram/openapi.yaml (8)

48-48: Legacy suffix appended to /edit summary
The summary Edit (legacy) correctly indicates this endpoint is deprecated in favor of newer versions.


99-99: Legacy suffix appended to /generate summary
Good use of (legacy) to flag the old /generate endpoint.


425-425: Legacy suffix appended to /reframe summary
The summary update to Reframe (legacy) is consistent with the deprecation strategy.


460-460: Legacy suffix appended to /remix summary
Marking /remix as legacy is clear and aligns with the other endpoints.


531-553: Comprehensive examples for /upscale
The x-fern-examples block here provides well-structured request, response, and code-samples sections, which enhances usability.


715-734: Validate /v1/ideogram-v3/reframe examples
The examples for /v1/ideogram-v3/reframe correctly include resolution and file uploads, and the code samples match the spec.


1936-1936: New CUSTOM style type added to StyleType enum
Adding CUSTOM expands flexibility, but please verify backend support and update any client-side mappings or validation logic to handle this new value.


2171-2171: Default for StyleTypeV3 changed from AUTO to GENERAL
Ensure that server-side defaults and client SDKs are aligned with this new default, and update any generated docs or tests accordingly.

Comment on lines +592 to +611
x-fern-examples:
- request:
prompt: A photo of a cat wearing a hat.
response:
body:
created: '2000-01-23T04:56:07.0000000+00:00'
data:
- prompt: A photo of a cat wearing a hat.
resolution: 1024x1024
is_image_safe: true
seed: 12345
url: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89
style_type: GENERAL
code-samples:
- sdk: curl
code: "curl -X POST https://api.ideogram.ai/v1/ideogram-v3/edit \\\n -H \"Api-Key: <apiKey>\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F image=@<file1> \\\n -F mask=@<file1> \\\n -F prompt=\"A photo of a cat wearing a hat.\" \\\n -F rendering_speed=\"DEFAULT\"\n"
- sdk: python
code: "import requests\n\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/ideogram-v3/edit\",\n headers={\n \"Api-Key\": \"<apiKey>\"\n },\n data={\n \"prompt\": \"A photo of a cat wearing a hat.\",\n \"rendering_speed\": \"DEFAULT\"\n },\n files={\n \"image\": open(\"<file1>\", \"rb\"),\n \"mask\": open(\"<file1>\", \"rb\"),\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n"
- sdk: typescript
code: "const formData = new FormData();\nformData.append('prompt', 'A photo of a cat');\nformData.append('rendering_speed', 'TURBO');\nconst response = await fetch('https://api.ideogram.ai/v1/ideogram-v3/edit', {\n method: 'POST',\n headers: { 'Api-Key': '<apiKey>' },\n body: formData\n});\nconst data = await response.json();\nconsole.log(data);\n"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Include file fields in /v1/ideogram-v3/edit request example
The request example lists only prompt, but the curl and SDK samples attach image and mask files as required by the spec. Update the example to include both binary fields:

x-fern-examples:
  - request:
      prompt: A photo of a cat wearing a hat.
      rendering_speed: DEFAULT
      image: <binary file>
      mask: <binary file>
🤖 Prompt for AI Agents (early access)
In src/libs/Ideogram/openapi.yaml between lines 592 and 611, the request example under x-fern-examples for the /v1/ideogram-v3/edit endpoint only includes the prompt field, but the curl and SDK code samples show that image and mask binary files are also required. Update the request example to add the image and mask fields as placeholders for binary files, and include the rendering_speed field to match the samples, ensuring the example accurately reflects the required multipart form data inputs.

Comment on lines +774 to +794
x-fern-examples:
- request:
prompt: A photo of a cat
rendering_speed: DEFAULT
image_weight: 50
aspect_ratio: 1x2
response:
body:
created: '2000-01-23T04:56:07.0000000+00:00'
data:
- prompt: A photo of a cat
resolution: 1280x800
is_image_safe: true
seed: 12345
url: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89
style_type: GENERAL
code-samples:
- sdk: curl
code: "curl -X POST https://api.ideogram.ai/v1/ideogram-v3/remix \\\n -H \"Api-Key: <apiKey>\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F image=@<file1> \\\n -F prompt=\"A photo of a cat\" \\\n -F rendering_speed=\"TURBO\"\n"
- sdk: python
code: "import requests\n\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/ideogram-v3/remix\",\n headers={\n \"Api-Key\": \"<apiKey>\"\n },\n data={\n \"prompt\": \"A photo of a cat\",\n \"rendering_speed\": \"TURBO\"\n },\n files={\n \"image\": open(\"<file1>\", \"rb\"),\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Align fields in /v1/ideogram-v3/remix examples
The request example lists image_weight and aspect_ratio, but code samples omit them. Update the code snippets to include:

-F image_weight=50 \
-F aspect_ratio="1x2"
🤖 Prompt for AI Agents (early access)
In src/libs/Ideogram/openapi.yaml around lines 774 to 794, the example request includes the fields image_weight and aspect_ratio, but these are missing in the curl and python code samples. Update both code samples to include the image_weight and aspect_ratio fields by adding -F image_weight=50 and -F aspect_ratio="1x2" to the curl command and adding corresponding entries in the data or files dictionary in the python example to match the request example.

Comment on lines +654 to +675
x-fern-examples:
- request:
prompt: A photo of a cat sleeping on a couch.
rendering_speed: TURBO
aspect_ratio: 1x1
response:
body:
created: '2000-01-23T04:56:07.0000000+00:00'
data:
- prompt: A photo of a cat sleeping on a couch.
resolution: 1024x1024
is_image_safe: true
seed: 12345
url: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89
style_type: GENERAL
code-samples:
- sdk: curl
code: "curl -X POST https://api.ideogram.ai/v1/ideogram-v3/generate \\\n -H \"Api-Key: <apiKey>\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F prompt=\"A photo of a cat sleeping on a couch.\" \\\n -F rendering_speed=\"TURBO\"\n"
- sdk: python
code: "import requests\n\n# Generate with Ideogram 3.0 (POST /v1/ideogram-v3/generate)\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/ideogram-v3/generate\",\n headers={\n \"Api-Key\": \"<apiKey>\"\n },\n json={\n \"prompt\": \"A picture of a cat\",\n \"rendering_speed\": \"TURBO\"\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n\n# Generate with style reference images\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/ideogram-v3/generate\",\n headers={\n \"Api-Key\": \"<apiKey>\"\n },\n data={\n \"prompt\": \"A picture of a cat\",\n \"aspect_ratio\": \"3x1\"\n },\n files=[\n (\"style_reference_images\", open(\"style_reference_image_1.png\", \"rb\")),\n (\"style_reference_images\", open(\"style_reference_image_2.png\", \"rb\")),\n ]\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n"
- sdk: typescript
code: "const formData = new FormData();\nformData.append('prompt', 'A photo of a cat');\nformData.append('rendering_speed', 'TURBO');\n// To add style reference images, uncomment the following lines\n// formData.append('style_reference_images', '<style_reference_image_1>');\n// formData.append('style_reference_images', '<style_reference_image_2>');\nconst response = await fetch('https://api.ideogram.ai/v1/ideogram-v3/generate', {\n method: 'POST',\n headers: { 'Api-Key': '<apiKey>' },\n body: formData\n});\nconst data = await response.json();\nconsole.log(data);\n"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Sync fields between request example and code samples for /v1/ideogram-v3/generate
The example request includes aspect_ratio, but code samples omit it and mix in different prompt text. Align these:

  • Ensure the curl snippet includes -F aspect_ratio="1x1".
  • Match the JSON payload in SDK examples to the documented fields and values.
🤖 Prompt for AI Agents (early access)
In src/libs/Ideogram/openapi.yaml around lines 654 to 675, the request example for the /v1/ideogram-v3/generate endpoint includes the field aspect_ratio with value "1x1", but the code samples omit this field and use different prompt text. To fix this, update the curl snippet to include -F aspect_ratio="1x1" and modify the JSON payloads in the Python and TypeScript SDK examples to match the documented request fields exactly, using prompt "A photo of a cat sleeping on a couch." and rendering_speed "TURBO" along with aspect_ratio "1x1" where applicable.

Comment on lines +836 to +857
x-fern-examples:
- request:
prompt: Add a forest in the background
magic_prompt: ON
rendering_speed: QUALITY
response:
body:
created: '2000-01-23T04:56:07.0000000+00:00'
data:
- prompt: Add a forest in the background
resolution: 1280x800
is_image_safe: true
seed: 12345
url: https://ideogram.ai/api/images/ephemeral/xtdZiqPwRxqY1Y7NExFmzB.png?exp=1743867804&sig=e13e12677633f646d8531a153d20e2d3698dca9ee7661ee5ba4f3b64e7ec3f89
style_type: GENERAL
code-samples:
- sdk: curl
code: "curl -X POST https://api.ideogram.ai/v1/ideogram-v3/replace-background \\\n -H \"Api-Key: <apiKey>\" \\\n -H \"Content-Type: multipart/form-data\" \\\n -F image=@<file1> \\\n -F prompt=\"Add a forest in the background\"\n"
- sdk: python
code: "import requests\n\nresponse = requests.post(\n \"https://api.ideogram.ai/v1/ideogram-v3/replace-background\",\n headers={\n \"Api-Key\": \"<apiKey>\" \n },\n data={\n \"prompt\": \"Add a forest in the background\",\n \"magic_prompt\": \"ON\"\n },\n files={\n \"image\": open(\"<file1>\", \"rb\"),\n }\n)\nprint(response.json())\nwith open('output.png', 'wb') as f:\n f.write(requests.get(response.json()['data'][0]['url']).content)\n"
- sdk: typescript
code: "const formData = new FormData();\nformData.append('prompt', 'Add a forest in the background');\nformData.append('image', '<file1>');\nconst response = await fetch('https://api.ideogram.ai/v1/ideogram-v3/replace-background', {\n method: 'POST',\n headers: { 'Api-Key': '<apiKey>' },\n body: formData\n});\nconst data = await response.json();\nconsole.log(data);\n"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Correct /v1/ideogram-v3/replace-background examples
The request example shows magic_prompt and rendering_speed, but code samples only include prompt (and miss attaching image). Align all examples and SDK snippets to:

  • Attach the binary image field.
  • Include both magic_prompt and rendering_speed as shown in the spec.
🤖 Prompt for AI Agents (early access)
In src/libs/Ideogram/openapi.yaml around lines 836 to 857, the example requests and SDK code samples for the /v1/ideogram-v3/replace-background endpoint are inconsistent. The request example includes magic_prompt and rendering_speed fields and attaches an image, but the code samples omit rendering_speed and do not properly attach the binary image file. Update all SDK code samples to include the magic_prompt and rendering_speed fields in the request body and ensure the image file is correctly attached as a binary file in the multipart/form-data payload, matching the request example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants