Logo

Execute a specific prompt

Runs a prompt using OpenAI model

POST
/prompt/{uuid}/openai

Authorization

api-key<token>

This is a required API key. It must be included in the header of all requests in the format: api-key: value.

In: header

Request Body

application/jsonRequired

messagestring

The message to be processed

structured_dataobject

A valid JSON Schema 7 object

Path Parameters

uuid
Required
string

UUID of the prompt to execute

Format: "uuid"
curl -X POST "https://api.systemprompt.io/v1/prompt/497f6eca-6276-4993-bfeb-53cbbbba6f08/openai" \
  -H "api-key: <apikey>" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Please analyze this text and provide feedback."
  }'

Prompt executed successfully

{
  "success": true,
  "data": {
    "message": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "role": "user",
      "content": "Please analyze this text and provide feedback.",
      "reference": [
        {}
      ],
      "model": "gpt-4o-mini",
      "metadata": {
        "title": "Title of the message",
        "description": "Description of the message",
        "tag": [
          "string"
        ],
        "created": "2024-01-01 00:00:00",
        "updated": "2024-01-01 00:00:00",
        "version": 1,
        "status": "published",
        "author": "John Doe"
      }
    },
    "conversation": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "message": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "role": "user",
          "content": "Please analyze this text and provide feedback.",
          "reference": [
            {}
          ],
          "model": "gpt-4o-mini",
          "metadata": {
            "title": "Title of the message",
            "description": "Description of the message",
            "tag": [
              "string"
            ],
            "created": "2024-01-01 00:00:00",
            "updated": "2024-01-01 00:00:00",
            "version": 1,
            "status": "published",
            "author": "John Doe"
          }
        }
      ],
      "metadata": {
        "title": "Research Analysis",
        "description": "A schema for analysing research data for blogs",
        "created": "2023-04-01T12:00:00Z",
        "updated": "2023-04-01T12:00:00Z",
        "version": 1,
        "status": "published",
        "tag": [
          "SystemPrompt",
          "Blog",
          "Conversation",
          "Text Output"
        ],
        "log_message": "Created a new research analysis",
        "author": "admin"
      },
      "_link": "string"
    },
    "structured_data": {}
  },
  "metadata": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "object": "chat.completion",
    "created": 1715619200,
    "model": "gpt-4o-mini",
    "system_fingerprint": "123e4567-e89b-12d3-a456-426614174000",
    "choices": [
      {}
    ],
    "usage": {
      "prompt_tokens": 10,
      "completion_tokens": 10,
      "total_tokens": 20
    }
  }
}