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

# How it works

> Get up and running in minutes!

### Overview

Here's a rough overview of how the API works:

1. Submit an application form and wait to get approved.
2. Generate an API key and safely store it for future use.
3. Purchase models or credits in the [studio](https://studio.tryitonai.com).
4. Train a model using the [train model](/api-reference/model/post-train-model) endpoint.
5. Fetch the images using the [get results](/api-reference/model/get-get-headshot-results) endpoint
6. Edit the images using any of our AI editing tools.

<Frame caption="We only save images uploaded for training, generated with models, or edited with AI tools. Models are automatically deleted once images are generated.">
  <img src="https://mintlify.s3-us-west-1.amazonaws.com/tryiton/images/api-graph.webp" />
</Frame>

<br />

<Info>
  We don't offer the <a href="https://studio.tryitonai.com/creative-studio"> Creative Studio </a> as part of the API yet.
  Do reach out if you'd like us to prioritize this feature.
</Info>

### Generate an API key

Head to the <a href="https://studio.tryitonai.com/developers">Developer Dashboard</a>, fill out an application, and we'll respond within 24 hours.
Once approved, create an API key, store it safely, and make sure you have enough <a href="https://studio.tryitonai.com/express">models</a> or <a href="https://studio.tryitonai.com/billing">credits</a>
to use the API.

To use the API key, set it as the `x-tryiton-key` request header in all the requests that you send to our public API.

<br />

<Tip>Your **API Key** is specific to your account. The models and credits used through the API are the same ones that you can use via your account.</Tip>

### Training Models

Once you've purchased models, fetch them using the [get models](/api-reference/model/get-get-models) endpoint.
Select the *model id* you'd like to train and pass it to the [train model](/api-reference/model/post-train-model) endpoint.

A model has to be trained before it can be used to generate images. Training a model is a one-time process and can take up to 24 hours to complete.

Once training begins, the `is_used` parameter will be set to `true`. Once training is complete, the `is_trained` parameter will be set to `true`.
The `email_sent` flag can be safely ignored (it's used to indicate when a user has been notified that their model is ready).

Once a model is trained, it cannot be retrained.

### Generating images

Image generation happens automatically once a model is trained depending on the styles you chose.
Users can also customize their images using the `customizations` parameter.

### Editing images

You can upload any URL to our AI image editing tools.
The max size is **1024x1024**, so we will resize the image if it's larger than that.

### No-Code Integrations

If you'd like to see any specific No-Code integrations such as Zapier, Wordpress, Wix, or others, drop us a line at
[nathan@tryitonai.com](nathan@tryitonai.com) and we'll get to it promptly!
