> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magnific.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Icon Generation - Text-to-Icon API | Magnific API

> Generate custom icons from text prompts with AI. Create PNG or SVG icons in 5 styles: solid, outline, color, flat, and sticker. Production-ready vector output for apps and websites.

<Card title="AI-powered icon generation" icon="icons">
  Generate custom icons from text descriptions using advanced AI models, with support for multiple styles and vector output formats.
</Card>

AI Icon Generation is a text-to-icon API that creates custom icons from natural language prompts. Describe the icon you need, and receive production-ready PNG or SVG files in your chosen style. The API supports 5 distinct visual styles and offers a preview workflow for rapid iteration before final rendering.

### Key capabilities

* **Text-to-icon generation**: Create icons from natural language descriptions (e.g., "A cute cat icon", "Shopping cart with heart")
* **Multiple output formats**: Export as PNG for raster graphics or SVG for scalable vector graphics
* **5 visual styles**: Choose from `solid`, `outline`, `color`, `flat`, or `sticker` styles
* **Preview workflow**: Generate quick previews before committing to final high-quality renders
* **Quality tuning**: Adjust `num_inference_steps` (10-50) and `guidance_scale` (0-10) for fine control
* **Async processing**: Webhook notifications for task completion
* **Vector-ready output**: SVG format for infinite scalability without quality loss

### Use cases

* **Mobile app development**: Generate consistent icon sets for iOS and Android applications
* **Web design**: Create custom icons matching your brand identity and design system
* **UI/UX prototyping**: Rapidly iterate on icon concepts during design exploration
* **Marketing materials**: Generate unique icons for presentations, infographics, and social media
* **Brand identity**: Create distinctive iconography that aligns with brand guidelines
* **E-commerce**: Generate product category icons, feature badges, and navigation elements

### Generate icons with the API

Create icons by submitting a text prompt with your desired style and format. Use the preview endpoint for quick iterations, then render the final output in your preferred format.

<div className="my-11">
  <Columns cols={2}>
    <Card title="POST /v1/ai/text-to-icon" icon="icons" href="/api-reference/icon-generation/post-generate-icon">
      Generate a new icon from text prompt
    </Card>

    <Card title="POST /v1/ai/text-to-icon/preview" icon="eye" href="/api-reference/icon-generation/post-preview">
      Generate a quick preview of the icon
    </Card>

    <Card title="POST /v1/ai/text-to-icon/{task-id}/render/{format}" icon="download" href="/api-reference/icon-generation/post-{format}-by-id">
      Download icon in PNG or SVG format
    </Card>
  </Columns>
</div>

### Parameters

| Parameter             | Type      | Required | Default | Description                                                          |
| --------------------- | --------- | -------- | ------- | -------------------------------------------------------------------- |
| `prompt`              | `string`  | Yes      | -       | Text description of the icon to generate (e.g., "A cute cat icon")   |
| `webhook_url`         | `string`  | Yes      | -       | URL for task completion notification                                 |
| `style`               | `string`  | No       | `solid` | Visual style: `solid`, `outline`, `color`, `flat`, or `sticker`      |
| `format`              | `string`  | No       | `png`   | Output format: `png` or `svg`                                        |
| `num_inference_steps` | `integer` | No       | `10`    | Generation quality steps (10-50, higher = better quality, slower)    |
| `guidance_scale`      | `number`  | No       | `7`     | Prompt adherence strength (0-10, higher = stricter prompt following) |

### Style reference

| Style     | Description                        | Best for                         |
| --------- | ---------------------------------- | -------------------------------- |
| `solid`   | Filled shapes with single color    | UI icons, navigation elements    |
| `outline` | Line-based icons with strokes      | Minimalist designs, light themes |
| `color`   | Multi-colored filled icons         | Marketing, illustrations         |
| `flat`    | Simplified shapes with flat colors | Modern app interfaces            |
| `sticker` | Decorative style with playful look | Social media, casual apps        |

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="What is AI Icon Generation and how does it work?">
    AI Icon Generation is a text-to-icon API that uses advanced AI models to create custom icons from natural language descriptions. You submit a prompt describing the icon you want (e.g., "A shopping cart icon"), choose a style and format, and receive a task ID. Poll for results or receive a webhook notification when the icon is ready. The output is a production-ready PNG or SVG file.
  </Accordion>

  <Accordion title="What output formats does AI Icon Generation support?">
    The API supports two output formats: PNG for raster graphics and SVG for scalable vector graphics. PNG is ideal for immediate use in web and mobile applications, while SVG provides infinite scalability without quality loss, perfect for responsive designs and print materials.
  </Accordion>

  <Accordion title="What are the available icon styles?">
    Five visual styles are available: `solid` (filled shapes), `outline` (line-based), `color` (multi-colored), `flat` (simplified modern), and `sticker` (decorative playful). Each style suits different design contexts - solid and outline work well for UI elements, while color and sticker are better for marketing and casual applications.
  </Accordion>

  <Accordion title="How do I write effective icon prompts?">
    Be specific and descriptive. Good examples: "A cute cat icon", "Shopping cart with a heart", "Lightning bolt in a circle", "Envelope with notification badge". Include the subject and any distinctive features. Avoid overly complex descriptions - icons work best as simple, recognizable symbols.
  </Accordion>

  <Accordion title="What is the difference between preview and generate endpoints?">
    The preview endpoint (`/preview`) generates a quick draft for rapid iteration during the design process. The main generate endpoint (`/v1/ai/text-to-icon`) creates the production-ready icon. Use previews to explore different prompts and styles, then generate the final version once satisfied.
  </Accordion>

  <Accordion title="How do num_inference_steps and guidance_scale affect output?">
    `num_inference_steps` (10-50) controls generation quality - higher values produce more refined icons but take longer. `guidance_scale` (0-10) determines how strictly the AI follows your prompt - higher values create icons more closely matching your description, while lower values allow more creative interpretation.
  </Accordion>

  <Accordion title="What are the rate limits for AI Icon Generation?">
    Rate limits vary by subscription tier. See [Rate Limits](/ratelimits) for current limits and quotas.
  </Accordion>

  <Accordion title="How much does AI Icon Generation cost?">
    See the [Pricing page](/pricing) for current rates and subscription options.
  </Accordion>
</AccordionGroup>

## Best practices

* **Prompt clarity**: Use clear, concise descriptions focusing on the core concept of the icon
* **Style consistency**: Use the same style across icon sets for visual coherence in your application
* **Preview first**: Use the preview endpoint to iterate quickly before generating final renders
* **SVG for scalability**: Choose SVG format when icons will be used at multiple sizes
* **Quality vs. speed**: Start with default `num_inference_steps` (10) for testing, increase for production
* **Guidance tuning**: Use higher `guidance_scale` (8-10) for literal interpretations, lower (4-6) for creative variations
* **Webhook integration**: Use webhooks instead of polling for production applications
* **Error handling**: Implement retry logic with exponential backoff for 503 errors

## Related APIs

* **[Magnific Mystic](/api-reference/mystic/mystic)**: Generate full illustrations and images from text prompts
* **[Image Upscaler](/api-reference/image-upscaler-creative/image-upscaler)**: Enhance icon resolution for high-DPI displays
* **[Background Removal](/api-reference/remove-background/overview)**: Remove backgrounds from existing icons or images
