API Documentation

prompts.chat provides an API for searching and discovering AI prompts programmatically.

Improve Prompt APIRequires Auth

Transform basic prompts into well-structured, comprehensive prompts using AI. The API uses embeddings to find similar prompts for inspiration and generates improved versions while preserving the original intent. Requires API key authentication.

ParameterTypeRequiredDescription
promptstringYesThe prompt to improve (max 10,000 chars)
outputTypestringNoContent type: text (default), image, video, sound
outputFormatstringNoResponse format: text (default), structured_json, structured_yaml
# Improve a prompt
curl -X POST https://community.lokimax.top/api/improve-prompt \
  -H "Content-Type: application/json" \
  -H "X-API-Key: pchat_your_api_key_here" \
  -d '{
    "prompt": "write a blog post about AI",
    "outputType": "text",
    "outputFormat": "text"
  }'

Response Format

{
  "original": "write a blog post about AI",
  "improved": "You are an expert technology writer...

## Task
Write an engaging blog post...",
  "outputType": "text",
  "outputFormat": "text",
  "inspirations": [
    { "title": "Blog Writer", "similarity": 85 },
    { "title": "Content Creator", "similarity": 72 }
  ],
  "model": "gpt-4o"
}

Try It Out

# API Request

curl -X POST /api/improve-prompt \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "",
    "outputType": "text",
    "outputFormat": "text"
  }'

REST API

Use the standard REST endpoint to search and retrieve prompts:

# Search prompts via REST
curl "https://community.lokimax.top/api/prompts?q=code+review&perPage=10"

# Get prompt by ID
curl "https://community.lokimax.top/api/prompts/{id}"

Rate Limits

The API is public and free to use. Please be respectful with request frequency. For high-volume usage, consider self-hosting your own instance.

Support

For issues and feature requests, please open a GitHub Issue.