MyImageToPrompt API

The MyImageToPrompt REST API lets you integrate our image-to-prompt AI capabilities directly into your own applications, tools, and workflows. Build custom integrations for Photoshop plugins, browser extensions, automation pipelines, or any creative tool you can imagine.

API Endpoints

POST /wp-json/mitp/v1/generate-prompt

Analyzes an image and generates an optimized AI prompt.

ParameterTypeRequiredDescription
imagestringYes*Base64-encoded image data URL (data:image/…)
modestringNoTarget platform: general, midjourney, sdxl, flux, dalle (default: general)
typestringNoInput type: image or text (default: image)
textstringYes*Text description to enhance (required if type=text)

*Either image or text is required depending on the type parameter.

POST /wp-json/mitp/v1/describe-image

Generates a comprehensive description of any image.

ParameterTypeRequiredDescription
imagestringYesBase64-encoded image data URL

Example Request

fetch('https://myimagetoprompt.com/wp-json/mitp/v1/generate-prompt', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    image: 'data:image/jpeg;base64,...',
    mode: 'midjourney'
  })
})
.then(res => res.json())
.then(data => console.log(data.prompt));

Example Response

{
  "success": true,
  "prompt": "Breathtaking mountain landscape at golden hour, dramatic peaks..."
}

Authentication

The API uses the site’s built-in REST API. For production use, include the X-WP-Nonce header with a valid WordPress nonce to avoid rate limiting. The API key for OpenAI is stored securely server-side — you never need to expose your OpenAI credentials.

Rate Limits

Free tier: 60 requests per hour per IP address. For higher limits or dedicated API access, contact us.

Use Cases

  • Browser extensions for instant image-to-prompt conversion
  • Photoshop / Lightroom plugins
  • Discord bots for AI art communities
  • Automated content pipelines
  • Custom AI art workflow applications