# Create Game SpriteSheet

The SpriteSheet Generation API allows developers to generate AI-powered 2D pixel-style spritesheets for use in game engines. By providing a textual prompt, the API will return a spritesheet in the requested style and format.

<figure><img src="https://storage.googleapis.com/rpggo-gameassets/CharacterSheet/4216a20242d342d092798c144aeeb803_G.png" alt=""><figcaption><p>Super Mario, Sheet</p></figcaption></figure>

<figure><img src="https://storage.googleapis.com/rpggo-imagegen/CHARACTER_SHEET/55b65302b14c4ebb9ba8e5737c28ca0c.gif" alt=""><figcaption><p>Super Mario, gif</p></figcaption></figure>

<figure><img src="https://storage.googleapis.com/rpggo-gameassets/CharacterSheet/b4cce51a8da64910987d623fb9b151aa_G.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://storage.googleapis.com/rpggo-imagegen/CHARACTER_SHEET/bd4d4612e6a8446cac796c97fba2824c.gif" alt=""><figcaption><p>Pikachu, gif</p></figcaption></figure>

### 1. Endpoint

```
POST https://api.rpggo.ai/v2/assets/spritesheet/create

```

### **2. Request Body**

<table><thead><tr><th>Name</th><th>Type</th><th width="137">Example Value</th><th>Description</th></tr></thead><tbody><tr><td>style</td><td>String</td><td>"v1"</td><td>Two versions available ["v1", "v2"]. Default is v1. </td></tr><tr><td>form</td><td>String</td><td>"sheet"</td><td>Tow formats available ["sheet", "gif"]. Default is "sheet", for game engine use case. "gif" is more suitable for profile, avatar needs.</td></tr><tr><td>prompt</td><td>String</td><td>"Super Mario in snow cloth"</td><td>Describe the appearance of the sprite sheet. Default is "", which means for a random generation.</td></tr><tr><td>scale_by</td><td>int</td><td>2</td><td>tile size of the sprite sheet. Default is 2.</td></tr></tbody></table>

<br>

> Note, you need to fill in your own api key in the curl. For how to apply api key, [apply-your-test-key](https://developer.rpggo.ai/dev-docs/support/apply-your-test-key "mention")

{% code title="Sample Curl" lineNumbers="true" %}

```bash
curl --location 'https://api.rpggo.ai/v2/assets/spritesheet/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: YOUR-API-KEY' \
--data '{
    "style": "v1",
    "prompt": "a girl",
    "form": "sheet",
    "scale_by": 2
}'
```

{% endcode %}

{% tabs %}
{% tab title="200: OK " %}
{% code lineNumbers="true" %}

```json
{
    "code": 200,
    "msg": "ok",
    "data": {
        "img_url": "https://storage.googleapis.com/rpggo-imagegen/CHARACTER_SHEET/54d9b5f8d25d4a1991eb2d2f26cdaa3f.gif"
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="10000008: Unauthorized " %}

```json
{
    "code": 10000008,
    "message": "Authentication failed，Invalid token"
}
```

{% endtab %}

{% tab title="10000000: Low balance" %}

```json
{​
    "code": 10000000,​
    "message": "user balance is not enough"​
}
```

{% endtab %}
{% endtabs %}

### **Rate Limits**

* each api call will spend 30 GG coins. Make sure you have balance in your account.
