Skip to main content
POST
Create Tool Version
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 | null

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