Download OpenAPI specification:Download
Welcome to the prompt engineering API by PromptLeo.
You can use this REST API to manage prompts library, submit online forms as well as trigger API endpoints. You need to register and add API keys first.
PromptLeo uses API keys to allow access to the API. You can sign in and get your API key on the account page or on the workspace settings page.
PromptLeo expects for the API key to be included in all API requests to the server in a header that looks like the following:
Authorization: Bearer API_KEY
All API requests are executed in the scope of a certain workspace and all endpoint paths always begin with the /{workspace_id}/
prefix. You can find your workspace ID on the workspace settings page.
Endpoints enable the execution of prompt templates over a REST API. To create an endpoint and connect it to your backend (like ChatGPT), you need to sign in. Once created, this endpoint can be executed via a REST API by specifying template parameters in the request body and then receiving the generated response for the custom prompt.
Passes the parameters from the request body to the prompt template, creates a final prompt and then passes it to the Generative AI backend configured. Returns the generated prompt answer. You can see the response to the prompt Which country is {city} in?
on the right.
name required | string Example: city_finder The name of the endpoint to be executed. |
Endpoint execution request
object Map of parameter names and values. | |
metadata | object Map of custom metadata perameters and values to be passed to the engine. |
{- "params": {
- "city": "Paris"
}
}
{- "status": "SUCCESS",
- "choices": [
- {
- "text": "Paris is the capital city of France, so it is located in France."
}
]
}
Load all available prompts. With a prompt ID, you can request its versions containing prompt text and parameters.
[- {
- "uid": "string",
- "name": "string",
- "dateCreated": "2023-02-18T14:41:18.000Z",
- "dateUpdated": "2023-02-18T14:41:18.000Z"
}
]
Create a new prompt object.
Prompt create request
name | string Name of a prompt. |
{- "name": "Idea Generator Prompt"
}
{- "uid": "e9f6318246",
- "name": "Idea Generator Prompt",
- "dateCreated": "2023-02-18T14:41:18.000Z",
- "dateUpdated": "2023-02-18T14:41:18.000Z"
}
Load a specific prompt object.
id required | string Example: e9f6318246 The ID of the prompt. |
{- "uid": "string",
- "name": "string",
- "dateCreated": "2023-02-18T14:41:18.000Z",
- "dateUpdated": "2023-02-18T14:41:18.000Z"
}
Update a prompt object.
id required | string Example: e9f6318246 The ID of the prompt. |
Prompt update request
name | string Name of a prompt. |
{- "name": "Idea Generator Prompt"
}
{- "uid": "string",
- "name": "string",
- "dateCreated": "2023-02-18T14:41:18.000Z",
- "dateUpdated": "2023-02-18T14:41:18.000Z"
}
Delete a specific prompt object.
id required | string Example: e9f6318246 The ID of the prompt. |
{- "uid": "string",
- "name": "string",
- "dateCreated": "2023-02-18T14:41:18.000Z",
- "dateUpdated": "2023-02-18T14:41:18.000Z"
}
Each prompt may contain many versions so that it's easy to test, improve and replace prompt texts used in production.
Load all versions of a prompt.
workspace_id required | string Example: e9f6318246 The ID of the workspace. |
id required | string Example: e9f6318246 The ID of the prompt. |
[- {
- "uid": "string",
- "name": "string",
- "content": "string",
- "dateCreated": "2023-02-18T14:41:18.000Z",
- "dateUpdated": "2023-02-18T14:41:18.000Z"
}
]
Create a new prompt version.
workspace_id required | string Example: e9f6318246 The ID of the workspace. |
id required | string Example: e9f6318246 The ID of the prompt. |
Prompt version create request
name | string Name of a prompt. |
content | string The text of the prompt. |
{- "name": "version-2",
- "content": "Which country is {city} in?"
}
{- "uid": "e9f6318246",
- "name": "version-2",
- "content": "Which country is {city} in?",
- "dateCreated": "2023-02-18T14:41:18.000Z",
- "dateUpdated": "2023-02-18T14:41:18.000Z"
}
Load a specific prompt version.
workspace_id required | string Example: e9f6318246 The ID of the workspace. |
id required | string Example: e9f6318246 The ID of the prompt. |
vid required | string Example: e9f6318246 The ID of the prompt version. |
{- "uid": "3eb6be3138",
- "name": "version-3",
- "content": "Which country is `{city}` in?",
- "dateCreated": "2023-02-18T14:41:18.000Z",
- "dateUpdated": "2023-02-18T14:41:18.000Z"
}
Update a prompt version.
workspace_id required | string Example: e9f6318246 The ID of the workspace. |
id required | string Example: e9f6318246 The ID of the prompt. |
vid required | string Example: e9f6318246 The ID of the prompt version. |
Prompt update request
name | string Name of a prompt. |
content | string The text of the prompt. |
{- "name": "version-2",
- "content": "Which country is {city} in?"
}
{- "uid": "3eb6be3138",
- "name": "version-3",
- "content": "Which country is `{city}` in?",
- "dateCreated": "2023-02-18T14:41:18.000Z",
- "dateUpdated": "2023-02-18T14:41:18.000Z"
}
Delete a specific prompt version.
workspace_id required | string Example: e9f6318246 The ID of the workspace. |
id required | string Example: e9f6318246 The ID of the prompt. |
vid required | string Example: e9f6318246 The ID of the prompt version. |
{- "uid": "3eb6be3138",
- "name": "version-3",
- "content": "Which country is `{city}` in?",
- "dateCreated": "2023-02-18T14:41:18.000Z",
- "dateUpdated": "2023-02-18T14:41:18.000Z"
}