# Quick Start

{% hint style="info" %}
**Good to know:** A quick start guide can be good to help folks get up and running with your API in a few steps. Some people prefer diving in with the basics rather than meticulously reading every page of documentation!
{% endhint %}

## Get your API keys

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.

You can generate an API key from your Dashboard at any time.

## Make your first request

To make your first request, send an authenticated request to the generate endpoint. This will create a generations, which is nice.

## Generate new images

<mark style="color:green;">`POST`</mark> `https://api.crazyhorse.ai/v1/generations`

Generate new images by your purpose

#### Headers

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| api-key<mark style="color:red;">\*</mark> | String | api key     |

#### Request Body

| Name                                     | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ---------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| params<mark style="color:red;">\*</mark> | object | <p><strong>These params</strong></p><p>  <code>hair</code>: string,</p><p>  <code>pose</code>: string,</p><p>  <code>body</code>: string,</p><p>  <code>chest</code>: string,</p><p>  <code>clothes</code>: string,</p><p>  <code>background</code>: string,</p><p>  <code>number</code>: number,</p><p>  <code>girlId</code>: string,</p><p>  <code>loraId</code>: string (<a href="https://civitai.com/">model</a>),</p><p>  <code>debug</code>: boolean,</p> |
| image<mark style="color:red;">\*</mark>  | string | base64                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

{% tabs %}
{% tab title="200 Image successfully created" %}

```javascript
{
  "state": "WAITING",
  "code": "string",
  "imageUrls": [
    "string"
  ],
  "params": {
    "hair": "string",
    "pose": "string",
    "body": "string",
    "chest": "string",
    "clothes": "string",
    "background": "string",
    "number": 10,
    "loraId": "string",
    "debug": true
  }
}
```

{% endtab %}

{% tab title="403: Forbidden Error" %}

```javascript
{
  "message": "API key does not exist",
  "errorCode": 5001,
  "statusCode": 403,
  "path": "/v1/generations",
  "error": true,
  "method": "POST"
}
```

{% endtab %}
{% endtabs %}

Take a look at how you might call this method using our official libraries, or via `node`:

{% tabs %}
{% tab title="Node" %}

```javascript
// require the axios module and set it up with your API key
const axios = require('axios').default;

const url = 'https://api.crazyhorse.ai/v1/generations';
const payload = {
    params: {
     "hair": "red",
     "pose": "",
     "body": "",
     "chest": "",
     "clothes": "t-shirt, jean",
     "background": "ocean",
     "number": 10,
     "girlId": "yuna-jp",
     "loraId": "115728",
     "debug": true
    },
    image: '/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxISEhUTEBIVFRUVFRUVFRUVFRUVFRYVFxcXFxUVFRUYHSggGBolHRUVITEhJSkrLi4uFx8zODMsNygtLisBCgoKDg0OGhAQGy0dHx0tLS0tLS0tLSstLS0tLS0tLSstKy0xLS0tKy0rLS0tLS0tKy0rKy0tLS0tLS0tLS0tLf/AABEIARMAtwMBIgACEQEDEQH/xAAcAAABBQEBAQAAAAAAAAAAAAAEAQIDBQYABwj/xAA/EAABAwIDBQUFBQgBBQEAAAABAAIRAyEEBTESQVFxgQYTImGRMqGxwdEHQlJichQjgpKy4fDxwhUzU5OiJP/EABkBAAMBAQEAAAAAAAAAAAAAAAABAgMEBf/EACERAQEAAgMAAgIDAAAAAAAAAAABAhEDITESQTJRBHHB/9oADAMBAAIRAxEAPwDSU/Y6KJgUwHg6KNgWSxdIWRYCHpDRFDR'
};
const options = {
   headers: {
     'api-key': 'xxxxxxxx'
   }
};
const genImage = away axios.post(url, payload, options)
```

{% endtab %}
{% endtabs %}
