API Tools API

Create reusable external HTTP tools that AI assistants can call.

Overview

API tools describe an external HTTP request, the values the AI must provide, and any fixed values that should always be sent. After a tool is created, associate it with an assistant by updating the assistant's api_tools array.

Base Endpoint: /api-tools

API Tool Object

json

Parameter Object

Use url_parameters for path and query values and body_parameters for JSON body values.

FieldTypeDescription
idStringClient-generated unique ID for the parameter
nameStringParameter name sent to the external API
typeStringstring, number, integer, boolean, array, or object
descriptionStringExplanation the AI uses to collect or infer the value
requiredBooleanWhether the value is required
enumString[]Optional allowed values
value_sourceStringai for AI-provided values or fixed for values you provide
fixed_valueAnyValue sent when value_source is fixed
locationStringFor URL parameters, query or path
propertiesParameter[]Nested fields for object parameters
itemsObjectItem schema for array parameters

Fixed Values vs AI Values

  • Use value_source: "ai" when the assistant should provide the value from the conversation.
  • Use value_source: "fixed" when the same value should always be sent and the assistant should not decide it.

Associate a Tool with an Assistant

After creating the API tool, add it to an assistant:

Available Operations

Report an issue with this documentation

Please log in to report issues with our documentation.