Portkey
App · 20 actions
Manage prompts and gateway configurations, inspect logs and run saved prompts.
Actions
| Action | What it does |
|---|---|
| Create config | Create a config. |
| Create prompt | Create a new prompt. |
| Delete config | Delete a config. |
| Delete prompt | Delete a prompt. |
| Get config | Get a config. |
| Get log | Get a specific log. |
| Get log export | Get a specific logs export. |
| Get prompt | Get a prompt by ID or slug. |
| Get prompt version | Get a specific version of a prompt. |
| Get virtual key | Get a Virtual Key. |
| List configs | List all configs. |
| List log exports | Get all logs exports. |
| List prompt versions | Get all versions of a prompt. |
| List prompts | List prompts. |
| List virtual keys | List All Virtual Keys. |
| List workspaces | Get All Workspaces. |
| Render prompt | Prompts Render. |
| Run prompt | Prompts Completions. |
| Update config | Update a config. |
| Update prompt | Update a prompt. |
Create config
Create a config.
Inputs
- Name
nametext - Name.
- Config
configobject - Config.
- Workspace id
workspace_idtext - optional, when using organisation admin API keys
Outputs
dataobject- Service response.
Example output
{
"data": {
"data": {
"id": "example",
"version_id": "example"
},
"success": false
}
}Create prompt
Create a new prompt.
Inputs
- Name
nametextRequired - Name.
- Collection id
collection_idtextRequired - UUID or slug of the collection
- String
stringtextRequired - Prompt template in string format
- Parameters
parametersobjectRequired - Parameters for the prompt
- Functions
functionslist - Functions for the prompt
- Tools
toolslist - Tools for the prompt
- Tool choice
tool_choiceobject - Tool Choice for the prompt
- Model
modeltext - The model to use for the prompt
- Virtual key
virtual_keytextRequired - The virtual key to use for the prompt
- Version description
version_descriptiontext - The description of the prompt version
- Template metadata
template_metadataobject - Metadata for the prompt
Outputs
dataobject- Service response.
Example output
{
"data": {
"id": "example",
"object": "prompt",
"slug": "example",
"version_id": "example"
}
}Delete config
Delete a config.
Inputs
- Slug
slugtextRequired - Slug.
Outputs
dataobject- Service response.
Example output
{
"data": {}
}Delete prompt
Delete a prompt.
Inputs
- Prompt
prompt_idtextRequired - Prompt id.
Outputs
dataobject- Service response.
Example output
{
"data": {}
}Get config
Get a config.
Inputs
- Slug
slugtextRequired - Slug.
Outputs
dataobject- Service response.
Example output
{
"data": {
"data": {
"config": {
"cache": {
"max_age": 1,
"mode": "example"
},
"retry": {
"attempts": 1,
"on_status_codes": []
},
"strategy": {
"mode": "example"
},
"targets": []
}
},
"success": false
}
}Get log
Get a specific log.
Inputs
- Log id
log_idtextRequired - Log id.
- Path format
path_formattext - Path format.One of:
v1,v2. Default:v1. - Created time
created_atdate and time - Created at.
- Type
typetext - Type.One of:
hooks.
Outputs
dataobject- Service response.
Example output
{
"data": {
"_id": "example",
"created_at": "2026-11-01T12:00:00Z",
"finalUntransformedRequest": {
"body": {},
"headers": {},
"method": "example",
"url": "example"
},
"metrics": {
"ai_model": "example",
"ai_org": "example",
"api_key_id": "example",
"cache_processing_time": 1,
"cache_status": "example",
"cache_type": "example",
"config": "example",
"config_id": "example",
"config_version_id": "example",
"cost": 1.0,
"cost_currency": "example",
"created_at": "2026-11-01T12:00:00Z",
"gateway_processing_time": 1,
"id": "example",
"internal_trace_id": "example",
"is_proxy_call": false,
"is_success": false,
"last_used_option_index": 1,
"log_store_file_path_format": "example",
"metadata.key": [],
"metadata.value": [],
"mode": "example",
"organisation_id": "example",
"organisation_name": "example",
"parent_span_id": "example",
"pre_processing_time": 1,
"prompt_id": "example",
"prompt_slug": "example",
"prompt_version_id": "example",
"req_units": 1.0,
"request_method": "example",
"request_parsing_time": 1,
"request_url": "example",
"res_units": 1.0,
"response_parsing_time": 1,
"response_status_code": 1,
"response_time": 1,
"retry_success_count": 1,
"runtime": "example",
"runtime_version": "example",
"sdk_version": "example",
"source": "example",
"span_id": "example",
"span_name": "example",
"stream_mode": 1,
"total_units": 1.0,
"trace_id": "example",
"upstream_response_time": 1,
"virtual_key": "example",
"workspace_slug": "example"
},
"organisation_id": "example",
"originalResponse": {
"body": {},
"headers": {},
"method": "example",
"url": "example"
},
"request": {
"body": {},
"headers": {},
"method": "GET",
"portkeyHeaders": {},
"url": "example"
},
"response": {
"body": {},
"headers": {},
"lastUsedOptionJsonPath": "example",
"responseTime": 1,
"status": 1
},
"transformedRequest": {
"body": {},
"headers": {},
"method": "example",
"url": "example"
}
}
}Get log export
Get a specific logs export.
Inputs
- Export id
export_idtextRequired - Export id.
Outputs
dataobject- Service response.
Example output
{
"data": {
"created_at": "2026-11-01T12:00:00Z",
"created_by": "example",
"description": "example",
"filters": {
"ai_model": "example",
"ai_org_model": "example",
"completion_token_max": 1,
"completion_token_min": 1,
"configs": "example",
"cost_max": 1.0,
"cost_min": 1.0,
"current_page": 1.0,
"metadata": {},
"page_size": 1.0,
"prompt_slug": "example",
"prompt_token_max": 1,
"prompt_token_min": 1,
"status_code": "example",
"time_of_generation_max": "2026-11-01T12:00:00Z",
"time_of_generation_min": "2026-11-01T12:00:00Z",
"total_units_max": 1,
"total_units_min": 1,
"trace_id": "example",
"virtual_keys": "example",
"weighted_feedback_max": 1.0,
"weighted_feedback_min": 1.0,
"workspace_slug": "example"
},
"id": "example",
"last_updated_at": "2026-11-01T12:00:00Z",
"object": "export",
"organisation_id": "example",
"requested_data": [],
"status": "draft",
"workspace_id": "example"
}
}Get prompt
Get a prompt by ID or slug.
Inputs
- Prompt
prompt_idtextRequired - Prompt id.
Outputs
dataobject- Service response.
Example output
{
"data": {
"collection_id": "example",
"created_at": "2026-11-01T12:00:00Z",
"functions": [],
"id": "example",
"is_raw_template": false,
"last_updated_at": "2026-11-01T12:00:00Z",
"model": "example",
"name": "example",
"parameters": {},
"prompt_version": 1.0,
"prompt_version_description": "example",
"prompt_version_id": "example",
"prompt_version_label_id": "example",
"prompt_version_status": "active",
"slug": "example",
"status": "example",
"string": "example",
"template_metadata": {},
"tool_choice": {},
"tools": [],
"virtual_key": "example"
}
}Get prompt version
Get a specific version of a prompt.
Inputs
- Prompt
prompt_idtextRequired - Prompt id.
- Version id
version_idtextRequired - Version id.
Outputs
dataobject- Service response.
Example output
{
"data": {
"collection_id": "example",
"created_at": "2026-11-01T12:00:00Z",
"functions": [],
"id": "example",
"is_raw_template": false,
"last_updated_at": "2026-11-01T12:00:00Z",
"model": "example",
"name": "example",
"parameters": {},
"prompt_version": 1.0,
"prompt_version_description": "example",
"prompt_version_id": "example",
"prompt_version_label_id": "example",
"prompt_version_status": "active",
"slug": "example",
"status": "example",
"string": "example",
"template_metadata": {},
"tool_choice": {},
"tools": [],
"virtual_key": "example"
}
}Get virtual key
Get a Virtual Key.
Inputs
- Slug
slugtextRequired - Slug.
Outputs
dataobject- Service response.
Example output
{
"data": {
"created_at": "2026-11-01T12:00:00Z",
"expires_at": "2026-11-01T12:00:00Z",
"model_config": {},
"name": "example",
"note": "example",
"object": "virtual-key",
"rate_limits": [],
"reset_usage": 1.0,
"secret_mappings": [],
"slug": "example",
"status": "active",
"usage_limits": {
"alert_threshold": 1,
"credit_limit": 1,
"next_usage_reset_at": "2026-11-01T12:00:00Z",
"periodic_reset": "monthly",
"periodic_reset_days": 1,
"type": "cost"
}
}
}List configs
List all configs.
Inputs
None.
Outputs
dataobject- Service response.
Example output
{
"data": {
"data": [],
"success": false
}
}List log exports
Get all logs exports.
Inputs
- Workspace id
workspace_idtext - Workspace id.
Outputs
dataobject- Service response.
Example output
{
"data": {
"data": [],
"object": "list",
"total": 1
}
}List prompt versions
Get all versions of a prompt.
Inputs
- Prompt
prompt_idtextRequired - Prompt id.
Outputs
datalist- Service response.
Example output
{
"data": []
}List prompts
List prompts.
Inputs
- Collection id
collection_idtext - Collection id.
- Workspace id
workspace_idtext - Workspace id.
- Current page
current_pagenumber - Current page.
- Page size
page_sizenumber - Page size.
- Search
searchtext - Search.
Outputs
dataobject- Service response.
Example output
{
"data": {
"data": [],
"total": 1
}
}List virtual keys
List All Virtual Keys.
Inputs
- Current page
current_pagenumberRequired - Current page.
- Page size
page_sizenumberRequired - Page size.
Outputs
dataobject- Service response.
Example output
{
"data": {
"data": [],
"object": "list",
"total": 1
}
}List workspaces
Get All Workspaces.
Inputs
- Page size
page_sizenumber - Page size.
- Current page
current_pagenumber - Current page.
- Name
nametext - Name.
- Exact name
exact_nametext - Exact name.
- Status
statustext - Status.One of:
active,archived.
Outputs
dataobject- Service response.
Example output
{
"data": {
"data": [],
"object": "list",
"total": 1
}
}Render prompt
Prompts Render.
Inputs
- Prompt
prompt_idtextRequired - Prompt id.
- Variables
variablesobjectRequired - Variables to substitute in the prompt template
- Hyperparameters
hyperparametersobject - **Note**: All hyperparameters are optional. Pass them at the root level, and not nested under `hyperparameters`. Their grouping here is for educational purposes only.
Outputs
dataobject- Service response.
Example output
{
"data": {
"data": {
"frequency_penalty": 1.0,
"function_call": "none",
"functions": [],
"logit_bias": {},
"logprobs": false,
"max_completion_tokens": 1,
"max_tokens": 1,
"messages": [],
"model": "example",
"n": 1,
"parallel_tool_calls": false,
"presence_penalty": 1.0,
"response_format": {
"type": "text"
},
"seed": 1,
"stop": "example",
"stream": false,
"stream_options": {
"include_usage": false
},
"temperature": 1.0,
"thinking": {
"budget_tokens": 1,
"type": "enabled"
},
"tool_choice": "none",
"tools": [],
"top_logprobs": 1,
"top_p": 1.0,
"user": "example"
},
"success": false
}
}Run prompt
Prompts Completions.
Inputs
- Prompt
prompt_idtextRequired - Prompt id.
- Variables
variablesobjectRequired - Variables to substitute in the prompt template
- Hyperparameters
hyperparametersobject - **Note**: All hyperparameters are optional. Pass them at the root level, and not nested under `hyperparameters`. Their grouping here is for educational purposes only.
Outputs
dataobject- Service response.
Example output
{
"data": {
"body": {
"choices": [],
"created": 1,
"id": "example",
"model": "example",
"object": "chat.completion",
"system_fingerprint": "example",
"usage": {
"completion_tokens": 1,
"completion_tokens_details": {
"accepted_prediction_tokens": 1,
"reasoning_tokens": 1,
"rejected_prediction_tokens": 1
},
"prompt_tokens": 1,
"prompt_tokens_details": {
"cached_tokens": 1
},
"total_tokens": 1
}
},
"headers": {},
"status": "example"
}
}Update config
Update a config.
Inputs
- Slug
slugtextRequired - Slug.
- Name
nametext - Name.
- Config
configobject - Config.
- Status
statustext - Status.
Outputs
dataobject- Service response.
Example output
{
"data": {
"data": {
"version_id": "example"
},
"success": false
}
}Update prompt
Update a prompt.
Inputs
- Prompt
prompt_idtextRequired - Prompt id.
- Name
nametext - Name.
- Collection id
collection_idtext - Collection id.
- String
stringtext - The prompt template string. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
- Parameters
parametersobject - Model parameters (e.g. temperature, max_tokens). When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
- Model
modeltext - The model identifier. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
- Virtual key
virtual_keytext - The virtual key to associate with this version. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
- Version description
version_descriptiontext - A human-readable description for this version. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
- Functions
functionslist - Function definitions available to the model. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
- Tools
toolslist - Tool definitions available to the model. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
- Tool choice
tool_choiceobject - Controls which tool the model uses. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
- Is raw template
is_raw_templatenumber - Whether the template string is raw (1) or processed (0). When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.One of:
0,1. - Prompt metadata
prompt_metadataobject - Additional metadata for the prompt version. When `patch` is `true`, this field is optional and will be inherited from the current latest version if omitted.
Outputs
dataobject- Service response.
Example output
{
"data": {
"id": "example",
"prompt_version_id": "example",
"slug": "example"
}
}