Welcome

This documentation provides comprehensive information about the Gnomy Image Generation API, which allows you to generate and manage images based on templates. The API is built using OpenAPI 3.1.0 specification and provides endpoints for managing projects, templates, and generated images.

Image Generation API Endpoints

View the OpenAPI specification file

Authentication

All API endpoints are authenticated using an API key. The API key should be included in the request header using the x-api-key header:

x-api-key: YOUR_API_KEY

Base URL

The API is accessible at:

https://api.gnomy.io

Key Features

  • Project Management: Create and manage image generation projects
  • Template Management: Handle templates for image generation
  • Image Generation: Generate and retrieve images based on templates
  • Pagination Support: All list endpoints support pagination
  • Error Handling: Comprehensive error responses for all endpoints

Example Usage

Here’s an example of how to generate an image using the API:

const data = {
  "template": "<TEMPLATE_ID>",
  "modifications": [
    {
      "name": "layer1",
      "text": "This is my text"
    },
    {
      "name": "photo",
      "image_url": "https://www.pathtomyphoto.com/1.jpg"
    }
  ]
}

fetch('https://api.gnomy.io/api/images', {
  method: 'POST',
  body: JSON.stringify(data),
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': '<YOUR_API_KEY>'
  }
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

This example demonstrates:

  • Setting up the request payload with template ID and modifications
  • Making a POST request to the images endpoint
  • Including the required headers (Content-Type and x-api-key)
  • Handling the response and potential errors

Welcome

This documentation provides comprehensive information about the Gnomy Image Generation API, which allows you to generate and manage images based on templates. The API is built using OpenAPI 3.1.0 specification and provides endpoints for managing projects, templates, and generated images.

Image Generation API Endpoints

View the OpenAPI specification file

Authentication

All API endpoints are authenticated using an API key. The API key should be included in the request header using the x-api-key header:

x-api-key: YOUR_API_KEY

Base URL

The API is accessible at:

https://api.gnomy.io

Key Features

  • Project Management: Create and manage image generation projects
  • Template Management: Handle templates for image generation
  • Image Generation: Generate and retrieve images based on templates
  • Pagination Support: All list endpoints support pagination
  • Error Handling: Comprehensive error responses for all endpoints

Example Usage

Here’s an example of how to generate an image using the API:

const data = {
  "template": "<TEMPLATE_ID>",
  "modifications": [
    {
      "name": "layer1",
      "text": "This is my text"
    },
    {
      "name": "photo",
      "image_url": "https://www.pathtomyphoto.com/1.jpg"
    }
  ]
}

fetch('https://api.gnomy.io/api/images', {
  method: 'POST',
  body: JSON.stringify(data),
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': '<YOUR_API_KEY>'
  }
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

This example demonstrates:

  • Setting up the request payload with template ID and modifications
  • Making a POST request to the images endpoint
  • Including the required headers (Content-Type and x-api-key)
  • Handling the response and potential errors