Context Keeper

Context Keeper · Acciones GPT

Prompt API

This is an API for saving, loading, and listing GPT prompts.

  • POST /save-prompt/Save Prompt

    Save a new prompt with a generated title, text, and visibility status. Returns a unique short code for the prompt.

  • GET /load-prompt/{short_code}Load Prompt

    Load a prompt using its unique short code, retrieving title, text, visibility, category, and short code. If no prompt is found, a 404 error is raised. Each access increments the prompt's load count. Parameter: short_code (str). Returns: PromptResponse with prompt details.

  • GET /list-popular-prompts/List Popular Prompts

    List popular public prompts. Sorts prompts based on the number of times they have been loaded. Returns only the specified number of prompts.

Esquema original API
{
  "openapi": "3.1.0",
  "info": {
    "title": "Prompt API",
    "description": "This is an API for saving, loading, and listing GPT prompts.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://cybrix.ai/prompt",
      "description": "Prompt API"
    }
  ],
  "paths": {
    "/save-prompt/": {
      "post": {
        "summary": "Save Prompt",
        "description": "Save a new prompt with a generated title, text, and visibility status.\nReturns a unique short code for the prompt.",
        "operationId": "save_prompt_save_prompt__post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Prompt"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Save a new prompt",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/load-prompt/{short_code}": {
      "get": {
        "summary": "Load Prompt",
        "description": "Load a prompt using its unique short code, retrieving title, text, visibility, category, and short code.\nIf no prompt is found, a 404 error is raised.\nEach access increments the prompt's load count.\nParameter: short_code (str).\nReturns: PromptResponse with prompt details.",
        "operationId": "load_prompt_load_prompt__short_code__get",
        "parameters": [
          {
            "name": "short_code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Short Code"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Load a saved prompt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromptResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/list-popular-prompts/": {
      "get": {
        "summary": "List Popular Prompts",
        "description": "List popular public prompts.\nSorts prompts based on the number of times they have been loaded.\nReturns only the specified number of prompts.",
        "operationId": "list_popular_prompts_list_popular_prompts__get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PopularPrompt"
                  },
                  "title": "Response List Popular Prompts List Popular Prompts  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "PopularPrompt": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title",
            "description": "The title of the prompt."
          },
          "short_code": {
            "type": "string",
            "title": "Short Code",
            "description": "The unique short code of the prompt."
          },
          "load_count": {
            "type": "integer",
            "title": "Load Count",
            "description": "Number of times the prompt has been loaded."
          },
          "category": {
            "type": "string",
            "title": "Category",
            "description": "The category of the prompt."
          }
        },
        "type": "object",
        "required": [
          "title",
          "short_code",
          "load_count",
          "category"
        ],
        "title": "PopularPrompt"
      },
      "Prompt": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title",
            "description": "The title of the prompt, generated by GPT."
          },
          "text": {
            "type": "string",
            "title": "Text",
            "description": "The text of the GPT prompt."
          },
          "is_public": {
            "type": "boolean",
            "title": "Is Public",
            "description": "Flag indicating if the prompt is public or private."
          },
          "category": {
            "type": "string",
            "title": "Category",
            "description": "The category of the prompt."
          }
        },
        "type": "object",
        "required": [
          "title",
          "text",
          "is_public",
          "category"
        ],
        "title": "Prompt"
      },
      "PromptResponse": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title",
            "description": "The title of the loaded prompt."
          },
          "text": {
            "type": "string",
            "title": "Text",
            "description": "The text content of the loaded prompt."
          },
          "is_public": {
            "type": "boolean",
            "title": "Is Public",
            "description": "Visibility status of the prompt, indicating if it's public or private."
          },
          "short_code": {
            "type": "string",
            "title": "Short Code",
            "description": "The unique short code associated with the prompt."
          }
        },
        "type": "object",
        "required": [
          "title",
          "text",
          "is_public",
          "short_code"
        ],
        "title": "PromptResponse"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  }
}