Skip to main content
POST
/
api
/
public
/
v2
/
tool-registry
/
{identifier}
/
versions
Create Tool Version
curl --request POST \
  --url https://api.promptlayer.com/api/public/v2/tool-registry/{identifier}/versions \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "tool_definition": {},
  "execution": {
    "code": "<string>"
  },
  "commit_message": "<string>"
}
'
{
  "success": true,
  "version": {}
}

Documentation Index

Fetch the complete documentation index at: https://docs.promptlayer.com/llms.txt

Use this file to discover all available pages before exploring further.

Create a new immutable version of an existing tool. Use this to update the schema or to attach an auto-execution body. The new version is assigned the next sequential version number. Pass a commit_message to leave an audit-trail note. If you include execution, PromptLayer will run the body in a sandbox whenever a prompt referencing this version is invoked. The code field is the function body only. The signature is generated server-side.

Authorizations

X-API-KEY
string
header
required

Headers

X-API-KEY
string
required

Path Parameters

identifier
string
required

Tool ID (numeric) or name

Body

application/json
tool_definition
object
required

Tool definition in OpenAI function-calling format

execution
object

Optional sandbox-executable body. When set, PromptLayer auto-runs the body between LLM turns whenever a prompt uses this version. See Auto Tool Execution.

commit_message
string | null

Commit message for the new version

Response

Version created

success
boolean
version
object