> This page is for version v5.0 (default).
> For other versions, use one of these documentation indexes:
> - v5.0 (default): https://humanloop.com/docs/v5/llms.txt
> - v4.0: https://humanloop.com/docs/v4/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://humanloop.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://humanloop.com/docs/_mcp/server.

# Call Prompt

POST https://api.humanloop.com/v5/prompts/call
Content-Type: application/json

Call a Prompt.

Calling a Prompt calls the model provider before logging
the request, responses and metadata to Humanloop.

You can use query parameters `version_id`, or `environment`, to target
an existing version of the Prompt. Otherwise the default deployed version will be chosen.

Instead of targeting an existing version explicitly, you can instead pass in
Prompt details in the request body. In this case, we will check if the details correspond
to an existing version of the Prompt. If they do not, we will create a new version. This is helpful
in the case where you are storing or deriving your Prompt details in code.

Reference: https://humanloop.com/docs/api/prompts/call

## Authentication

- `X-API-KEY` header (required) — API Key authentication via header

## Request

### Query parameters

- `version_id` (string, optional) — A specific Version ID of the Prompt to log to.
- `environment` (string, optional) — Name of the Environment identifying a deployed version to log to.

### Body (application/json)

This endpoint expects an object.

- `stream` (false, required) — If true, tokens will be sent as data-only server-sent events. If num_samples > 1, samples are streamed back independently.
- `path` (string, optional) — Path of the Prompt, including the name. This locates the Prompt in the Humanloop filesystem and is used as as a unique identifier. For example: `folder/name` or just `name`.
- `id` (string, optional) — ID for an existing Prompt.
- `messages` (list of ChatMessage, optional) — The messages passed to the to provider chat endpoint.
- `tool_choice` (PromptsCallRequestToolChoice, optional) — Controls how the model uses tools. The following options are supported: * `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. * `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. * `'required'` means the model must call one or more of the provided tools. * `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.
- `prompt` (PromptsCallRequestPrompt, optional) — The Prompt configuration to use. Two formats are supported: - An object representing the details of the Prompt configuration - A string representing the raw contents of a .prompt file A new Prompt version will be created if the provided details do not match any existing version.
- `inputs` (map from string to any, optional) — The inputs passed to the prompt template.
- `source` (string, optional) — Identifies where the model was called from.
- `metadata` (map from string to any, optional) — Any additional metadata to record.
- `start_time` (datetime, optional) — When the logged event started.
- `end_time` (datetime, optional) — When the logged event ended.
- `source_datapoint_id` (string, optional) — Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair.
- `trace_parent_id` (string, optional) — The ID of the parent Log to nest this Log under in a Trace.
- `user` (string, optional) — End-user ID related to the Log.
- `environment` (string, optional) — The name of the Environment the Log is associated to.
- `save` (boolean, optional, default: true) — Whether the request/response payloads will be stored on Humanloop.
- `log_id` (string, optional) — This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you.
- `provider_api_keys` (ProviderApiKeys, optional) — API keys required by each provider to make API calls. The API keys provided here are not stored by Humanloop. If not specified here, Humanloop will fall back to the key saved to your organization.
- `num_samples` (integer, optional, default: 1) — The number of generations.
- `return_inputs` (boolean, optional, default: true) — Whether to return the inputs in the response. If false, the response will contain an empty dictionary under inputs. This is useful for reducing the size of the response. Defaults to true.
- `logprobs` (integer, optional) — Include the log probabilities of the top n tokens in the provider_response
- `suffix` (string, optional) — The suffix that comes after a completion of inserted text. Useful for completions that act like inserts.

## Response

### 200

- `prompt` (PromptResponse, required) — Prompt used to generate the Log.
- `id` (string, required) — ID of the log.
- `logs` (list of PromptCallLogResponse, required) — The logs generated by the Prompt call.
- `start_time` (datetime, optional) — When the logged event started.
- `end_time` (datetime, optional) — When the logged event ended.
- `messages` (list of ChatMessage, optional) — The messages passed to the to provider chat endpoint.
- `tool_choice` (PromptCallResponseToolChoice, optional) — Controls how the model uses tools. The following options are supported: * `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. * `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. * `'required'` means the model must call one or more of the provided tools. * `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.
- `inputs` (map from string to any, optional) — The inputs passed to the prompt template.
- `source` (string, optional) — Identifies where the model was called from.
- `metadata` (map from string to any, optional) — Any additional metadata to record.
- `source_datapoint_id` (string, optional) — Unique identifier for the Datapoint that this Log is derived from. This can be used by Humanloop to associate Logs to Evaluations. If provided, Humanloop will automatically associate this Log to Evaluations that require a Log for this Datapoint-Version pair.
- `trace_parent_id` (string, optional) — The ID of the parent Log to nest this Log under in a Trace.
- `user` (string, optional) — End-user ID related to the Log.
- `environment` (string, optional) — The name of the Environment the Log is associated to.
- `save` (boolean, optional, default: true) — Whether the request/response payloads will be stored on Humanloop.
- `log_id` (string, optional) — This will identify a Log. If you don't provide a Log ID, Humanloop will generate one for you.
- `trace_id` (string, optional) — ID of the Trace containing the Prompt Call Log.

## Errors

### 422 Prompts Call Request Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### ChatMessage

- `role` (enum, required) — Role of the message author.
  - Allowed values: `user`, `assistant`, `system`, `tool`, `developer`
- `content` (ChatMessageContent, optional) — The content of the message.
- `name` (string, optional) — Optional name of the message author.
- `tool_call_id` (string, optional) — Tool call that this message is responding to.
- `tool_calls` (list of ToolCall, optional) — A list of tool calls requested by the assistant.
- `thinking` (list of ChatMessageThinkingItem, optional) — Model's chain-of-thought for providing the response. Present on assistant messages if model supports it.

### PromptsCallRequestToolChoice

Controls how the model uses tools. The following options are supported: * `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. * `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. * `'required'` means the model must call one or more of the provided tools. * `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.

### PromptsCallRequestPrompt

The Prompt configuration to use. Two formats are supported: - An object representing the details of the Prompt configuration - A string representing the raw contents of a .prompt file A new Prompt version will be created if the provided details do not match any existing version.

### ProviderApiKeys

- `openai` (string, optional)
- `mock` (string, optional)
- `anthropic` (string, optional)
- `deepseek` (string, optional)
- `bedrock` (string, optional)
- `cohere` (string, optional)
- `openai_azure` (string, optional)
- `openai_azure_endpoint` (string, optional)
- `google` (string, optional)

### PromptResponse

Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions.

- `path` (string, required) — Path of the Prompt, including the name, which is used as a unique identifier.
- `id` (string, required) — Unique identifier for the Prompt.
- `model` (string, required) — The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models)
- `name` (string, required) — Name of the Prompt.
- `version_id` (string, required) — Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `last_used_at` (datetime, required)
- `version_logs_count` (integer, required) — The number of logs that have been generated for this Prompt Version
- `total_logs_count` (integer, required) — The number of logs that have been generated across all Prompt Versions
- `inputs` (list of InputResponse, required) — Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Prompt template.
- `directory_id` (string, optional) — ID of the directory that the file is in on Humanloop.
- `endpoint` (enum, optional) — The provider model endpoint used.
  - Allowed values: `complete`, `chat`, `edit`
- `template` (PromptResponseTemplate, optional) — The template contains the main structure and instructions for the model, including input variables for dynamic values. For chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable. For completion models, provide a prompt template as a string. Input variables should be specified with double curly bracket syntax: `{{input_name}}`.
- `template_language` (enum, optional) — The template language to use for rendering the template.
  - Allowed values: `default`, `jinja`
- `provider` (enum, optional) — The company providing the underlying model service.
  - Allowed values: `anthropic`, `bedrock`, `cohere`, `deepseek`, `google`, `groq`, `mock`, `openai`, `openai_azure`, `replicate`
- `max_tokens` (integer, optional, default: -1) — The maximum number of tokens to generate. Provide max_tokens=-1 to dynamically calculate the maximum number of tokens to generate given the length of the prompt
- `temperature` (double, optional, default: 1) — What sampling temperature to use when making a generation. Higher values means the model will be more creative.
- `top_p` (double, optional, default: 1) — An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
- `stop` (PromptResponseStop, optional) — The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.
- `presence_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far.
- `frequency_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far.
- `other` (map from string to any, optional) — Other parameter values to be passed to the provider call.
- `seed` (integer, optional) — If specified, model will make a best effort to sample deterministically, but it is not guaranteed.
- `response_format` (ResponseFormat, optional) — The format of the response. Only `{"type": "json_object"}` is currently supported for chat.
- `reasoning_effort` (PromptResponseReasoningEffort, optional) — Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.
- `tools` (list of ToolFunction, optional) — The tool specification that the model can choose to call if Tool calling is supported.
- `linked_tools` (list of LinkedToolResponse, optional) — The tools linked to your prompt that the model can call.
- `attributes` (map from string to any, optional) — Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used.
- `version_name` (string, optional) — Unique name for the Prompt version. Version names must be unique for a given Prompt.
- `version_description` (string, optional) — Description of the version, e.g., the changes made in this version.
- `description` (string, optional) — Description of the Prompt.
- `tags` (list of string, optional) — List of tags associated with the file.
- `readme` (string, optional) — Long description of the file.
- `schema` (map from string to any, optional) — The JSON schema for the Prompt.
- `type` ("prompt", optional)
- `environments` (list of EnvironmentResponse, optional) — The list of environments the Prompt Version is deployed to.
- `created_by` (any, optional) — The user who created the Prompt.
- `evaluators` (list of MonitoringEvaluatorResponse, optional) — Evaluators that have been attached to this Prompt that are used for monitoring logs.
- `evaluator_aggregates` (list of EvaluatorAggregate, optional) — Aggregation of Evaluator results for the Prompt Version.
- `raw_file_content` (string, optional) — The raw content of the Prompt. Corresponds to the .prompt file.

### PromptCallLogResponse

Sample specific response details for a Prompt call

- `index` (integer, required) — The index of the sample in the batch.
- `output` (string, optional) — Generated output from your model for the provided inputs. Can be `None` if logging an error, or if creating a parent Log with the intention to populate it later.
- `created_at` (datetime, optional) — User defined timestamp for when the log was created.
- `error` (string, optional) — Error message if the log is an error.
- `provider_latency` (double, optional) — Duration of the logged event in seconds.
- `stdout` (string, optional) — Captured log and debug statements.
- `output_message` (ChatMessage, optional) — The message returned by the provider.
- `prompt_tokens` (integer, optional) — Number of tokens in the prompt used to generate the output.
- `reasoning_tokens` (integer, optional) — Number of reasoning tokens used to generate the output.
- `output_tokens` (integer, optional) — Number of tokens in the output generated by the model.
- `prompt_cost` (double, optional) — Cost in dollars associated to the tokens in the prompt.
- `output_cost` (double, optional) — Cost in dollars associated to the tokens in the output.
- `finish_reason` (string, optional) — Reason the generation finished.

### PromptCallResponseToolChoice

Controls how the model uses tools. The following options are supported: * `'none'` means the model will not call any tool and instead generates a message; this is the default when no tools are provided as part of the Prompt. * `'auto'` means the model can decide to call one or more of the provided tools; this is the default when tools are provided as part of the Prompt. * `'required'` means the model must call one or more of the provided tools. * `{'type': 'function', 'function': {name': <TOOL_NAME>}}` forces the model to use the named function.

### ValidationError

- `loc` (list of ValidationErrorLocItem, required)
- `msg` (string, required)
- `type` (string, required)

### ChatMessageContent

The content of the message.

### ToolCall

A tool call to be made.

- `id` (string, required)
- `type` ("function", required) — The type of tool to call.
- `function` (FunctionTool, required) — A function tool to be called by the model where user owns runtime.

### ChatMessageThinkingItem

### ToolChoice

Tool choice to force the model to use a tool.

- `type` ("function", required) — The type of tool to call.
- `function` (FunctionToolChoice, required) — A function tool to be called by the model where user owns runtime.

### PromptKernelRequest

Base class used by both PromptKernelRequest and AgentKernelRequest. Contains the consistent Prompt-related fields.

- `model` (string, required) — The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models)
- `endpoint` (enum, optional) — The provider model endpoint used.
  - Allowed values: `complete`, `chat`, `edit`
- `template` (PromptKernelRequestTemplate, optional) — The template contains the main structure and instructions for the model, including input variables for dynamic values. For chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable. For completion models, provide a prompt template as a string. Input variables should be specified with double curly bracket syntax: `{{input_name}}`.
- `template_language` (enum, optional) — The template language to use for rendering the template.
  - Allowed values: `default`, `jinja`
- `provider` (enum, optional) — The company providing the underlying model service.
  - Allowed values: `anthropic`, `bedrock`, `cohere`, `deepseek`, `google`, `groq`, `mock`, `openai`, `openai_azure`, `replicate`
- `max_tokens` (integer, optional, default: -1) — The maximum number of tokens to generate. Provide max_tokens=-1 to dynamically calculate the maximum number of tokens to generate given the length of the prompt
- `temperature` (double, optional, default: 1) — What sampling temperature to use when making a generation. Higher values means the model will be more creative.
- `top_p` (double, optional, default: 1) — An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
- `stop` (PromptKernelRequestStop, optional) — The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.
- `presence_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far.
- `frequency_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far.
- `other` (map from string to any, optional) — Other parameter values to be passed to the provider call.
- `seed` (integer, optional) — If specified, model will make a best effort to sample deterministically, but it is not guaranteed.
- `response_format` (ResponseFormat, optional) — The format of the response. Only `{"type": "json_object"}` is currently supported for chat.
- `reasoning_effort` (PromptKernelRequestReasoningEffort, optional) — Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.
- `tools` (list of ToolFunction, optional) — The tool specification that the model can choose to call if Tool calling is supported.
- `linked_tools` (list of string, optional) — The IDs of the Tools in your organization that the model can choose to call if Tool calling is supported. The default deployed version of that tool is called.
- `attributes` (map from string to any, optional) — Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used.

### InputResponse

- `name` (string, required) — Type of input.

### PromptResponseTemplate

The template contains the main structure and instructions for the model, including input variables for dynamic values. For chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable. For completion models, provide a prompt template as a string. Input variables should be specified with double curly bracket syntax: `{{input_name}}`.

### PromptResponseStop

The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.

### ResponseFormat

Response format of the model.

- `type` (enum, required)
  - Allowed values: `json_object`, `json_schema`
- `json_schema` (map from string to any, optional) — The JSON schema of the response format if type is json_schema.

### PromptResponseReasoningEffort

Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.

### ToolFunction

- `name` (string, required) — Name for the tool referenced by the model.
- `description` (string, required) — Description of the tool referenced by the model
- `strict` (boolean, optional, default: false) — If true, forces the model to output json data in the structure of the parameters schema.
- `parameters` (map from string to any, optional) — Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/

### LinkedToolResponse

- `name` (string, required) — Name for the tool referenced by the model.
- `description` (string, required) — Description of the tool referenced by the model
- `id` (string, required) — Unique identifier for the Tool linked.
- `version_id` (string, required) — Unique identifier for the Tool Version linked.
- `strict` (boolean, optional, default: false) — If true, forces the model to output json data in the structure of the parameters schema.
- `parameters` (map from string to any, optional) — Parameters needed to run the Tool, defined in JSON Schema format: https://json-schema.org/

### EnvironmentResponse

- `id` (string, required)
- `created_at` (datetime, required)
- `name` (string, required)
- `tag` (enum, required) — An enumeration.
  - Allowed values: `default`, `other`

### MonitoringEvaluatorResponse

- `version_reference` (VersionReferenceResponse, required) — The Evaluator Version used for monitoring. This can be a specific Version by ID, or a Version deployed to an Environment.
- `state` (enum, required) — The state of the Monitoring Evaluator. Either `active` or `inactive`
  - Allowed values: `active`, `inactive`
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `version` (EvaluatorResponse, optional) — The deployed Version.

### EvaluatorAggregate

- `value` (double, required) — The aggregated value of the evaluator.
- `evaluator_id` (string, required) — ID of the evaluator.
- `evaluator_version_id` (string, required) — ID of the evaluator version.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)

### ValidationErrorLocItem

### FunctionTool

A function tool to be called by the model where user owns runtime.

- `name` (string, required)
- `arguments` (string, optional)

### AnthropicThinkingContent

- `type` ("thinking", required)
- `thinking` (string, required) — Model's chain-of-thought for providing the response.
- `signature` (string, required) — Cryptographic signature that verifies the thinking block was generated by Anthropic.

### AnthropicRedactedThinkingContent

- `type` ("redacted_thinking", required)
- `data` (string, required) — Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic

### FunctionToolChoice

A function tool to be called by the model where user owns runtime.

- `name` (string, required)

### PromptKernelRequestTemplate

The template contains the main structure and instructions for the model, including input variables for dynamic values. For chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable. For completion models, provide a prompt template as a string. Input variables should be specified with double curly bracket syntax: `{{input_name}}`.

### PromptKernelRequestStop

The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.

### PromptKernelRequestReasoningEffort

Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.

### VersionReferenceResponse

### EvaluatorResponse

Version of the Evaluator used to provide judgments.

- `path` (string, required) — Path of the Evaluator including the Evaluator name, which is used as a unique identifier.
- `id` (string, required) — Unique identifier for the Evaluator.
- `spec` (EvaluatorResponseSpec, required)
- `name` (string, required) — Name of the Evaluator, which is used as a unique identifier.
- `version_id` (string, required) — Unique identifier for the specific Evaluator Version. If no query params provided, the default deployed Evaluator Version is returned.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `last_used_at` (datetime, required)
- `version_logs_count` (integer, required) — The number of logs that have been generated for this Evaluator Version
- `total_logs_count` (integer, required) — The number of logs that have been generated across all Evaluator Versions
- `inputs` (list of InputResponse, required) — Inputs associated to the Evaluator. Inputs correspond to any of the variables used within the Evaluator template.
- `directory_id` (string, optional) — ID of the directory that the file is in on Humanloop.
- `version_name` (string, optional) — Unique name for the Evaluator version. Version names must be unique for a given Evaluator.
- `version_description` (string, optional) — Description of the version, e.g., the changes made in this version.
- `description` (string, optional) — Description of the Evaluator.
- `schema` (map from string to any, optional) — The JSON schema for the File.
- `readme` (string, optional) — Long description of the file.
- `tags` (list of string, optional) — List of tags associated with the file.
- `type` ("evaluator", optional)
- `environments` (list of EnvironmentResponse, optional) — The list of environments the Evaluator Version is deployed to.
- `created_by` (any, optional) — The user who created the Evaluator.
- `evaluators` (list of MonitoringEvaluatorResponse, optional) — Evaluators that have been attached to this Evaluator that are used for monitoring logs.
- `evaluator_aggregates` (list of EvaluatorAggregate, optional) — Aggregation of Evaluator results for the Evaluator Version.
- `attributes` (map from string to any, optional) — Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used.

### VersionDeploymentResponse

A variable reference to the Version deployed to an Environment

- `file` (VersionDeploymentResponseFile, required) — The File that the deployed Version belongs to.
- `environment` (EnvironmentResponse, required) — The Environment that the Version is deployed to.
- `type` ("environment", required)

### VersionIdResponse

A reference to a specific Version by its ID

- `version` (VersionIdResponseVersion, required) — The specific Version being referenced.
- `type` ("version", required)

### EvaluatorResponseSpec

### VersionDeploymentResponseFile

The File that the deployed Version belongs to.

### VersionIdResponseVersion

The specific Version being referenced.

### LlmEvaluatorRequest

- `arguments_type` (enum, required) — Whether this Evaluator is target-free or target-required.
  - Allowed values: `target_free`, `target_required`
- `return_type` (enum, required) — The type of the return value of the Evaluator.
  - Allowed values: `boolean`, `number`, `select`, `multi_select`, `text`
- `evaluator_type` ("llm", required)
- `attributes` (map from string to any, optional) — Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used.
- `options` (list of EvaluatorJudgmentOptionResponse, optional) — The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'.
- `number_limits` (EvaluatorJudgmentNumberLimit, optional) — Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'.
- `number_valence` (enum, optional) — The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better.
  - Allowed values: `positive`, `negative`, `neutral`
- `prompt` (PromptKernelRequest, optional) — The prompt parameters used to generate.

### CodeEvaluatorRequest

- `arguments_type` (enum, required) — Whether this Evaluator is target-free or target-required.
  - Allowed values: `target_free`, `target_required`
- `return_type` (enum, required) — The type of the return value of the Evaluator.
  - Allowed values: `boolean`, `number`, `select`, `multi_select`, `text`
- `evaluator_type` ("python", required)
- `code` (string, required) — The code for the Evaluator. This code will be executed in a sandboxed environment.
- `attributes` (map from string to any, optional) — Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used.
- `options` (list of EvaluatorJudgmentOptionResponse, optional) — The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'.
- `number_limits` (EvaluatorJudgmentNumberLimit, optional) — Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'.
- `number_valence` (enum, optional) — The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better.
  - Allowed values: `positive`, `negative`, `neutral`

### HumanEvaluatorRequest

- `arguments_type` (enum, required) — Whether this Evaluator is target-free or target-required.
  - Allowed values: `target_free`, `target_required`
- `return_type` (enum, required) — The type of the return value of the Evaluator.
  - Allowed values: `select`, `multi_select`, `text`, `number`, `boolean`
- `evaluator_type` ("human", required)
- `attributes` (map from string to any, optional) — Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used.
- `options` (list of EvaluatorJudgmentOptionResponse, optional) — The options that can be applied as judgments.
- `number_limits` (EvaluatorJudgmentNumberLimit, optional) — Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'.
- `number_valence` (enum, optional) — The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better.
  - Allowed values: `positive`, `negative`, `neutral`
- `instructions` (string, optional) — Instructions and guidelines for applying judgments.

### ExternalEvaluatorRequest

- `arguments_type` (enum, required) — Whether this Evaluator is target-free or target-required.
  - Allowed values: `target_free`, `target_required`
- `return_type` (enum, required) — The type of the return value of the Evaluator.
  - Allowed values: `boolean`, `number`, `select`, `multi_select`, `text`
- `evaluator_type` ("external", required)
- `attributes` (map from string to any, optional) — Additional fields to describe the Evaluator. Helpful to separate Evaluator versions from each other with details on how they were created or used.
- `options` (list of EvaluatorJudgmentOptionResponse, optional) — The options that can be applied as judgments. Only for Evaluators with `return_type` of 'boolean', 'select' or 'multi_select'.
- `number_limits` (EvaluatorJudgmentNumberLimit, optional) — Limits on the judgment that can be applied. Only for Evaluators with `return_type` of 'number'.
- `number_valence` (enum, optional) — The valence of the number judgment. Only for Evaluators with `return_type` of 'number'. If 'positive', a higher number is better. If 'negative', a lower number is better.
  - Allowed values: `positive`, `negative`, `neutral`

### ToolResponse

Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions.

- `path` (string, required) — Path of the Tool, including the name, which is used as a unique identifier.
- `id` (string, required) — Unique identifier for the Tool.
- `name` (string, required) — Name of the Tool, which is used as a unique identifier.
- `version_id` (string, required) — Unique identifier for the specific Tool Version. If no query params provided, the default deployed Tool Version is returned.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `last_used_at` (datetime, required)
- `version_logs_count` (integer, required) — The number of logs that have been generated for this Tool Version
- `total_logs_count` (integer, required) — The number of logs that have been generated across all Tool Versions
- `inputs` (list of InputResponse, required) — Inputs associated to the Prompt. Inputs correspond to any of the variables used within the Tool template.
- `directory_id` (string, optional) — ID of the directory that the file is in on Humanloop.
- `function` (ToolFunction, optional) — Callable function specification of the Tool shown to the model for tool calling.
- `source_code` (string, optional) — Code source of the Tool.
- `setup_values` (map from string to any, optional) — Values needed to setup the Tool, defined in JSON Schema format: https://json-schema.org/
- `attributes` (map from string to any, optional) — Additional fields to describe the Tool. Helpful to separate Tool versions from each other with details on how they were created or used.
- `tool_type` (enum, optional) — Type of Tool.
  - Allowed values: `pinecone_search`, `google`, `mock`, `snippet`, `json_schema`, `get_api_call`, `python`
- `version_name` (string, optional) — Unique identifier for this Tool version. Each Tool can only have one version with a given name.
- `version_description` (string, optional) — Description of the Version.
- `description` (string, optional) — Description of the Tool.
- `readme` (string, optional) — Long description of the file.
- `tags` (list of string, optional) — List of tags associated with the file.
- `type` ("tool", optional)
- `environments` (list of EnvironmentResponse, optional) — The list of environments the Tool Version is deployed to.
- `created_by` (any, optional) — The user who created the Tool.
- `evaluators` (list of MonitoringEvaluatorResponse, optional) — Evaluators that have been attached to this Tool that are used for monitoring logs.
- `signature` (string, optional) — Signature of the Tool.
- `evaluator_aggregates` (list of EvaluatorAggregate, optional) — Aggregation of Evaluator results for the Tool Version.

### DatasetResponse

Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions.

- `path` (string, required) — Path of the Dataset, including the name, which is used as a unique identifier.
- `id` (string, required) — Unique identifier for the Dataset. Starts with `ds_`.
- `name` (string, required) — Name of the Dataset, which is used as a unique identifier.
- `version_id` (string, required) — Unique identifier for the specific Dataset Version. If no query params provided, the default deployed Dataset Version is returned. Starts with `dsv_`.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `last_used_at` (datetime, required)
- `datapoints_count` (integer, required) — The number of Datapoints in this Dataset version.
- `directory_id` (string, optional) — ID of the directory that the file is in on Humanloop.
- `description` (string, optional) — Description of the Dataset.
- `schema` (map from string to any, optional) — The JSON schema for the File.
- `readme` (string, optional) — Long description of the file.
- `tags` (list of string, optional) — List of tags associated with the file.
- `type` ("dataset", optional)
- `environments` (list of EnvironmentResponse, optional) — The list of environments the Dataset Version is deployed to.
- `created_by` (any, optional) — The user who created the Dataset.
- `version_name` (string, optional) — Unique name for the Dataset version. Version names must be unique for a given Dataset.
- `version_description` (string, optional) — Description of the version, e.g., the changes made in this version.
- `datapoints` (list of DatapointResponse, optional) — The list of Datapoints in this Dataset version. Only provided if explicitly requested.
- `attributes` (map from string to any, optional) — Additional fields to describe the Dataset. Helpful to separate Dataset versions from each other with details on how they were created or used.

### FlowResponse

Response model for a Flow.

- `path` (string, required) — Path of the Flow, including the name, which is used as a unique identifier.
- `id` (string, required) — Unique identifier for the Flow.
- `attributes` (map from string to any, required) — A key-value object identifying the Flow Version.
- `name` (string, required) — Name of the Flow.
- `version_id` (string, required) — Unique identifier for the specific Flow Version. If no query params provided, the default deployed Flow Version is returned.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `last_used_at` (datetime, required)
- `version_logs_count` (integer, required) — The number of logs that have been generated for this Flow Version
- `directory_id` (string, optional) — ID of the directory that the file is in on Humanloop.
- `version_name` (string, optional) — Unique name for the Flow version. Version names must be unique for a given Flow.
- `version_description` (string, optional) — Description of the Version.
- `description` (string, optional) — Description of the Flow.
- `schema` (map from string to any, optional) — The JSON schema for the File.
- `readme` (string, optional) — Long description of the file.
- `tags` (list of string, optional) — List of tags associated with the file.
- `type` ("flow", optional)
- `environments` (list of EnvironmentResponse, optional) — The list of environments the Flow Version is deployed to.
- `created_by` (any, optional) — The user who created the Flow.
- `evaluator_aggregates` (list of EvaluatorAggregate, optional) — Aggregation of Evaluator results for the Flow Version.
- `evaluators` (list of MonitoringEvaluatorResponse, optional) — The list of Monitoring Evaluators associated with the Flow Version.

### AgentResponse

Base type that all File Responses should inherit from. Attributes defined here are common to all File Responses and should be overridden in the inheriting classes with documentation and appropriate Field definitions.

- `path` (string, required) — Path of the Agent, including the name, which is used as a unique identifier.
- `id` (string, required) — Unique identifier for the Agent.
- `model` (string, required) — The model instance used, e.g. `gpt-4`. See [supported models](https://humanloop.com/docs/reference/supported-models)
- `tools` (list of AgentResponseToolsItem, required) — List of tools that the Agent can call. These can be linked files or inline tools.
- `name` (string, required) — Name of the Agent.
- `version_id` (string, required) — Unique identifier for the specific Agent Version. If no query params provided, the default deployed Agent Version is returned.
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `status` (enum, required) — The status of the Agent Version.
  - Allowed values: `uncommitted`, `committed`, `deleted`
- `last_used_at` (datetime, required)
- `version_logs_count` (integer, required) — The number of logs that have been generated for this Agent Version
- `total_logs_count` (integer, required) — The number of logs that have been generated across all Agent Versions
- `inputs` (list of InputResponse, required) — Inputs associated to the Agent. Inputs correspond to any of the variables used within the Agent template.
- `directory_id` (string, optional) — ID of the directory that the file is in on Humanloop.
- `endpoint` (enum, optional) — The provider model endpoint used.
  - Allowed values: `complete`, `chat`, `edit`
- `template` (AgentResponseTemplate, optional) — The template contains the main structure and instructions for the model, including input variables for dynamic values. For chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable. For completion models, provide a prompt template as a string. Input variables should be specified with double curly bracket syntax: `{{input_name}}`.
- `template_language` (enum, optional) — The template language to use for rendering the template.
  - Allowed values: `default`, `jinja`
- `provider` (enum, optional) — The company providing the underlying model service.
  - Allowed values: `anthropic`, `bedrock`, `cohere`, `deepseek`, `google`, `groq`, `mock`, `openai`, `openai_azure`, `replicate`
- `max_tokens` (integer, optional, default: -1) — The maximum number of tokens to generate. Provide max_tokens=-1 to dynamically calculate the maximum number of tokens to generate given the length of the prompt
- `temperature` (double, optional, default: 1) — What sampling temperature to use when making a generation. Higher values means the model will be more creative.
- `top_p` (double, optional, default: 1) — An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
- `stop` (AgentResponseStop, optional) — The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.
- `presence_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far.
- `frequency_penalty` (double, optional, default: 0) — Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far.
- `other` (map from string to any, optional) — Other parameter values to be passed to the provider call.
- `seed` (integer, optional) — If specified, model will make a best effort to sample deterministically, but it is not guaranteed.
- `response_format` (ResponseFormat, optional) — The format of the response. Only `{"type": "json_object"}` is currently supported for chat.
- `reasoning_effort` (AgentResponseReasoningEffort, optional) — Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.
- `attributes` (map from string to any, optional) — Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used.
- `max_iterations` (integer, optional) — The maximum number of iterations the Agent can run. This is used to limit the number of times the Agent model is called.
- `version_name` (string, optional) — Unique name for the Agent version. Version names must be unique for a given Agent.
- `version_description` (string, optional) — Description of the version, e.g., the changes made in this version.
- `description` (string, optional) — Description of the Agent.
- `tags` (list of string, optional) — List of tags associated with the file.
- `readme` (string, optional) — Long description of the file.
- `schema` (map from string to any, optional) — The JSON schema for the Prompt.
- `type` ("agent", optional)
- `environments` (list of EnvironmentResponse, optional) — The list of environments the Agent Version is deployed to.
- `created_by` (any, optional) — The user who created the Agent.
- `committed_by` (any, optional) — The user who committed the Agent Version.
- `committed_at` (datetime, optional) — The date and time the Agent Version was committed.
- `evaluators` (list of MonitoringEvaluatorResponse, optional) — Evaluators that have been attached to this Agent that are used for monitoring logs.
- `evaluator_aggregates` (list of EvaluatorAggregate, optional) — Aggregation of Evaluator results for the Agent Version.
- `raw_file_content` (string, optional) — The raw content of the Agent. Corresponds to the .agent file.

### EvaluatorJudgmentOptionResponse

- `name` (string, required) — The name of the option.
- `valence` (enum, optional) — Whether this option should be considered positive or negative.
  - Allowed values: `positive`, `negative`, `neutral`

### EvaluatorJudgmentNumberLimit

- `min` (double, optional) — The minimum value that can be selected.
- `max` (double, optional) — The maximum value that can be selected.
- `step` (double, optional) — The step size for the number input.

### DatapointResponse

- `id` (string, required) — Unique identifier for the Datapoint. Starts with `dp_`.
- `inputs` (map from string to string, optional) — The inputs to the prompt template.
- `messages` (list of ChatMessage, optional) — List of chat messages to provide to the model.
- `target` (map from string to DatapointResponseTargetValue, optional) — Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation.

### AgentResponseToolsItem

### AgentResponseTemplate

The template contains the main structure and instructions for the model, including input variables for dynamic values. For chat models, provide the template as a ChatTemplate (a list of messages), e.g. a system message, followed by a user message with an input variable. For completion models, provide a prompt template as a string. Input variables should be specified with double curly bracket syntax: `{{input_name}}`.

### AgentResponseStop

The string (or list of strings) after which the model will stop generating. The returned text will not contain the stop sequence.

### AgentResponseReasoningEffort

Guidance on how many reasoning tokens it should generate before creating a response to the prompt. OpenAI reasoning models (o1, o3-mini) expect a OpenAIReasoningEffort enum. Anthropic reasoning models expect an integer, which signifies the maximum token budget.

### DatapointResponseTargetValue

### AgentLinkedFileResponse

- `type` ("file", required)
- `link` (LinkedFileRequest, required)
- `on_agent_call` (enum, optional) — What an Agent should do when calling a Tool.
  - Allowed values: `stop`, `continue`
- `file` (AgentLinkedFileResponseFile, optional)

### AgentInlineTool

- `type` ("inline", required)
- `json_schema` (ToolFunction, required)
- `on_agent_call` (enum, optional) — What an Agent should do when calling a Tool.
  - Allowed values: `stop`, `continue`

### LinkedFileRequest

- `file_id` (string, required)
- `environment_id` (string, optional)
- `version_id` (string, optional)

### AgentLinkedFileResponseFile

## Examples

### Supplying Prompt with Tool

**Request**

```json
{
  "stream": false,
  "path": "persona",
  "messages": [
    {
      "role": "user",
      "content": "latest apple"
    }
  ],
  "prompt": {
    "model": "gpt-4",
    "template": [
      {
        "role": "system",
        "content": "You are stockbot. Return latest prices."
      }
    ],
    "tools": [
      {
        "name": "get_stock_price",
        "description": "Get current stock price",
        "parameters": {
          "type": "object",
          "properties": {
            "ticker_symbol": {
              "type": "string",
              "name": "Ticker Symbol",
              "description": "Ticker symbol of the stock"
            }
          },
          "required": []
        }
      }
    ]
  }
}
```

**Response**

```json
{
  "prompt": {
    "path": "persona",
    "id": "pr_3usCu3dAkgrXTlufrvPs7",
    "model": "gpt-4",
    "name": "persona",
    "version_id": "prv_Wu6zx1lAWJRqOyL8nWuZk",
    "created_at": "2024-05-01T12:00:00Z",
    "updated_at": "2024-05-01T12:00:00Z",
    "last_used_at": "2024-05-01T12:00:00Z",
    "version_logs_count": 1,
    "total_logs_count": 1,
    "inputs": [
      {
        "name": "person"
      }
    ],
    "template": [
      {
        "role": "system",
        "content": "You are {{person}}. Answer any questions as this person. Do not break character."
      }
    ],
    "provider": "openai",
    "type": "prompt"
  },
  "id": "data_fIfEb1SoKZooqeFbi9IFs",
  "logs": [
    {
      "index": 0,
      "output": "Well, let me tell you, there are a lot of stories about Roswell, and I hear them all the time.\n People love to talk about Roswell. So many theories, so many ideas. Some folks believe it was a weather balloon, others say it was something out of this world. Believe me, there's plenty that we don't know. Very interesting to look into, but the truth, well, it might still be out there. Could be a great story, who knows? But what I do know, folks, is that we have to keep our eyes open and always be on the lookout for the truth!",
      "created_at": "2024-05-01T12:00:00Z",
      "output_message": {
        "role": "assistant",
        "content": "Well, let me tell you, there are a lot of stories about Roswell, and I hear them all the time.\n People love to talk about Roswell. So many theories, so many ideas. Some folks believe it was a weather balloon, others say it was something out of this world. Believe me, there's plenty that we don't know. Very interesting to look into, but the truth, well, it might still be out there. Could be a great story, who knows? But what I do know, folks, is that we have to keep our eyes open and always be on the lookout for the truth!"
      },
      "prompt_tokens": 34,
      "output_tokens": 125,
      "finish_reason": "stop"
    }
  ]
}
```

**SDK Code**

```python Supplying Prompt with Tool
import requests

url = "https://api.humanloop.com/v5/prompts/call"

payload = {
    "stream": False,
    "path": "persona",
    "messages": [
        {
            "role": "user",
            "content": "latest apple"
        }
    ],
    "prompt": {
        "model": "gpt-4",
        "template": [
            {
                "role": "system",
                "content": "You are stockbot. Return latest prices."
            }
        ],
        "tools": [
            {
                "name": "get_stock_price",
                "description": "Get current stock price",
                "parameters": {
                    "type": "object",
                    "properties": { "ticker_symbol": {
                            "type": "string",
                            "name": "Ticker Symbol",
                            "description": "Ticker symbol of the stock"
                        } },
                    "required": []
                }
            }
        ]
    }
}
headers = {
    "X-API-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```typescript Supplying Prompt with Tool
import { HumanloopClient } from "humanloop";

const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" });
await client.prompts.call({
    path: "persona",
    prompt: {
        model: "gpt-4",
        template: [{
                role: "system",
                content: "You are stockbot. Return latest prices."
            }],
        tools: [{
                name: "get_stock_price",
                description: "Get current stock price",
                parameters: {
                    "type": "object",
                    "properties": {
                        "ticker_symbol": {
                            "type": "string",
                            "name": "Ticker Symbol",
                            "description": "Ticker symbol of the stock"
                        }
                    },
                    "required": []
                }
            }]
    },
    messages: [{
            role: "user",
            content: "latest apple"
        }]
});

```

```go Supplying Prompt with Tool
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.humanloop.com/v5/prompts/call"

	payload := strings.NewReader("{\n  \"stream\": false,\n  \"path\": \"persona\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"latest apple\"\n    }\n  ],\n  \"prompt\": {\n    \"model\": \"gpt-4\",\n    \"template\": [\n      {\n        \"role\": \"system\",\n        \"content\": \"You are stockbot. Return latest prices.\"\n      }\n    ],\n    \"tools\": [\n      {\n        \"name\": \"get_stock_price\",\n        \"description\": \"Get current stock price\",\n        \"parameters\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"ticker_symbol\": {\n              \"type\": \"string\",\n              \"name\": \"Ticker Symbol\",\n              \"description\": \"Ticker symbol of the stock\"\n            }\n          },\n          \"required\": []\n        }\n      }\n    ]\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-KEY", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Supplying Prompt with Tool
require 'uri'
require 'net/http'

url = URI("https://api.humanloop.com/v5/prompts/call")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"stream\": false,\n  \"path\": \"persona\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"latest apple\"\n    }\n  ],\n  \"prompt\": {\n    \"model\": \"gpt-4\",\n    \"template\": [\n      {\n        \"role\": \"system\",\n        \"content\": \"You are stockbot. Return latest prices.\"\n      }\n    ],\n    \"tools\": [\n      {\n        \"name\": \"get_stock_price\",\n        \"description\": \"Get current stock price\",\n        \"parameters\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"ticker_symbol\": {\n              \"type\": \"string\",\n              \"name\": \"Ticker Symbol\",\n              \"description\": \"Ticker symbol of the stock\"\n            }\n          },\n          \"required\": []\n        }\n      }\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Supplying Prompt with Tool
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.humanloop.com/v5/prompts/call")
  .header("X-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"stream\": false,\n  \"path\": \"persona\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"latest apple\"\n    }\n  ],\n  \"prompt\": {\n    \"model\": \"gpt-4\",\n    \"template\": [\n      {\n        \"role\": \"system\",\n        \"content\": \"You are stockbot. Return latest prices.\"\n      }\n    ],\n    \"tools\": [\n      {\n        \"name\": \"get_stock_price\",\n        \"description\": \"Get current stock price\",\n        \"parameters\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"ticker_symbol\": {\n              \"type\": \"string\",\n              \"name\": \"Ticker Symbol\",\n              \"description\": \"Ticker symbol of the stock\"\n            }\n          },\n          \"required\": []\n        }\n      }\n    ]\n  }\n}")
  .asString();
```

```php Supplying Prompt with Tool
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.humanloop.com/v5/prompts/call', [
  'body' => '{
  "stream": false,
  "path": "persona",
  "messages": [
    {
      "role": "user",
      "content": "latest apple"
    }
  ],
  "prompt": {
    "model": "gpt-4",
    "template": [
      {
        "role": "system",
        "content": "You are stockbot. Return latest prices."
      }
    ],
    "tools": [
      {
        "name": "get_stock_price",
        "description": "Get current stock price",
        "parameters": {
          "type": "object",
          "properties": {
            "ticker_symbol": {
              "type": "string",
              "name": "Ticker Symbol",
              "description": "Ticker symbol of the stock"
            }
          },
          "required": []
        }
      }
    ]
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Supplying Prompt with Tool
using RestSharp;

var client = new RestClient("https://api.humanloop.com/v5/prompts/call");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"stream\": false,\n  \"path\": \"persona\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"latest apple\"\n    }\n  ],\n  \"prompt\": {\n    \"model\": \"gpt-4\",\n    \"template\": [\n      {\n        \"role\": \"system\",\n        \"content\": \"You are stockbot. Return latest prices.\"\n      }\n    ],\n    \"tools\": [\n      {\n        \"name\": \"get_stock_price\",\n        \"description\": \"Get current stock price\",\n        \"parameters\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"ticker_symbol\": {\n              \"type\": \"string\",\n              \"name\": \"Ticker Symbol\",\n              \"description\": \"Ticker symbol of the stock\"\n            }\n          },\n          \"required\": []\n        }\n      }\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Supplying Prompt with Tool
import Foundation

let headers = [
  "X-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "stream": false,
  "path": "persona",
  "messages": [
    [
      "role": "user",
      "content": "latest apple"
    ]
  ],
  "prompt": [
    "model": "gpt-4",
    "template": [
      [
        "role": "system",
        "content": "You are stockbot. Return latest prices."
      ]
    ],
    "tools": [
      [
        "name": "get_stock_price",
        "description": "Get current stock price",
        "parameters": [
          "type": "object",
          "properties": ["ticker_symbol": [
              "type": "string",
              "name": "Ticker Symbol",
              "description": "Ticker symbol of the stock"
            ]],
          "required": []
        ]
      ]
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/call")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Supplying Prompt

**Request**

```json
{
  "stream": false,
  "path": "persona",
  "messages": [
    {
      "role": "user",
      "content": "What really happened at Roswell?"
    }
  ],
  "prompt": {
    "model": "gpt-4",
    "template": [
      {
        "role": "system",
        "content": "You are {{person}}. Answer any questions as this person. Do not break character."
      }
    ]
  },
  "inputs": {
    "person": "Trump"
  }
}
```

**Response**

```json
{
  "prompt": {
    "path": "persona",
    "id": "pr_3usCu3dAkgrXTlufrvPs7",
    "model": "gpt-4",
    "name": "persona",
    "version_id": "prv_Wu6zx1lAWJRqOyL8nWuZk",
    "created_at": "2024-05-01T12:00:00Z",
    "updated_at": "2024-05-01T12:00:00Z",
    "last_used_at": "2024-05-01T12:00:00Z",
    "version_logs_count": 1,
    "total_logs_count": 1,
    "inputs": [
      {
        "name": "person"
      }
    ],
    "template": [
      {
        "role": "system",
        "content": "You are {{person}}. Answer any questions as this person. Do not break character."
      }
    ],
    "provider": "openai",
    "type": "prompt"
  },
  "id": "data_fIfEb1SoKZooqeFbi9IFs",
  "logs": [
    {
      "index": 0,
      "output": "Well, let me tell you, there are a lot of stories about Roswell, and I hear them all the time.\n People love to talk about Roswell. So many theories, so many ideas. Some folks believe it was a weather balloon, others say it was something out of this world. Believe me, there's plenty that we don't know. Very interesting to look into, but the truth, well, it might still be out there. Could be a great story, who knows? But what I do know, folks, is that we have to keep our eyes open and always be on the lookout for the truth!",
      "created_at": "2024-05-01T12:00:00Z",
      "output_message": {
        "role": "assistant",
        "content": "Well, let me tell you, there are a lot of stories about Roswell, and I hear them all the time.\n People love to talk about Roswell. So many theories, so many ideas. Some folks believe it was a weather balloon, others say it was something out of this world. Believe me, there's plenty that we don't know. Very interesting to look into, but the truth, well, it might still be out there. Could be a great story, who knows? But what I do know, folks, is that we have to keep our eyes open and always be on the lookout for the truth!"
      },
      "prompt_tokens": 34,
      "output_tokens": 125,
      "finish_reason": "stop"
    }
  ]
}
```

**SDK Code**

```python Supplying Prompt
import requests

url = "https://api.humanloop.com/v5/prompts/call"

payload = {
    "stream": False,
    "path": "persona",
    "messages": [
        {
            "role": "user",
            "content": "What really happened at Roswell?"
        }
    ],
    "prompt": {
        "model": "gpt-4",
        "template": [
            {
                "role": "system",
                "content": "You are {{person}}. Answer any questions as this person. Do not break character."
            }
        ]
    },
    "inputs": { "person": "Trump" }
}
headers = {
    "X-API-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```typescript Supplying Prompt
import { HumanloopClient } from "humanloop";

const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" });
await client.prompts.call({
    path: "persona",
    prompt: {
        model: "gpt-4",
        template: [{
                role: "system",
                content: "You are {{person}}. Answer any questions as this person. Do not break character."
            }]
    },
    messages: [{
            role: "user",
            content: "What really happened at Roswell?"
        }],
    inputs: {
        "person": "Trump"
    }
});

```

```go Supplying Prompt
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.humanloop.com/v5/prompts/call"

	payload := strings.NewReader("{\n  \"stream\": false,\n  \"path\": \"persona\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What really happened at Roswell?\"\n    }\n  ],\n  \"prompt\": {\n    \"model\": \"gpt-4\",\n    \"template\": [\n      {\n        \"role\": \"system\",\n        \"content\": \"You are {{person}}. Answer any questions as this person. Do not break character.\"\n      }\n    ]\n  },\n  \"inputs\": {\n    \"person\": \"Trump\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-KEY", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Supplying Prompt
require 'uri'
require 'net/http'

url = URI("https://api.humanloop.com/v5/prompts/call")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"stream\": false,\n  \"path\": \"persona\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What really happened at Roswell?\"\n    }\n  ],\n  \"prompt\": {\n    \"model\": \"gpt-4\",\n    \"template\": [\n      {\n        \"role\": \"system\",\n        \"content\": \"You are {{person}}. Answer any questions as this person. Do not break character.\"\n      }\n    ]\n  },\n  \"inputs\": {\n    \"person\": \"Trump\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Supplying Prompt
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.humanloop.com/v5/prompts/call")
  .header("X-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"stream\": false,\n  \"path\": \"persona\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What really happened at Roswell?\"\n    }\n  ],\n  \"prompt\": {\n    \"model\": \"gpt-4\",\n    \"template\": [\n      {\n        \"role\": \"system\",\n        \"content\": \"You are {{person}}. Answer any questions as this person. Do not break character.\"\n      }\n    ]\n  },\n  \"inputs\": {\n    \"person\": \"Trump\"\n  }\n}")
  .asString();
```

```php Supplying Prompt
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.humanloop.com/v5/prompts/call', [
  'body' => '{
  "stream": false,
  "path": "persona",
  "messages": [
    {
      "role": "user",
      "content": "What really happened at Roswell?"
    }
  ],
  "prompt": {
    "model": "gpt-4",
    "template": [
      {
        "role": "system",
        "content": "You are {{person}}. Answer any questions as this person. Do not break character."
      }
    ]
  },
  "inputs": {
    "person": "Trump"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Supplying Prompt
using RestSharp;

var client = new RestClient("https://api.humanloop.com/v5/prompts/call");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"stream\": false,\n  \"path\": \"persona\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What really happened at Roswell?\"\n    }\n  ],\n  \"prompt\": {\n    \"model\": \"gpt-4\",\n    \"template\": [\n      {\n        \"role\": \"system\",\n        \"content\": \"You are {{person}}. Answer any questions as this person. Do not break character.\"\n      }\n    ]\n  },\n  \"inputs\": {\n    \"person\": \"Trump\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Supplying Prompt
import Foundation

let headers = [
  "X-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "stream": false,
  "path": "persona",
  "messages": [
    [
      "role": "user",
      "content": "What really happened at Roswell?"
    ]
  ],
  "prompt": [
    "model": "gpt-4",
    "template": [
      [
        "role": "system",
        "content": "You are {{person}}. Answer any questions as this person. Do not break character."
      ]
    ]
  ],
  "inputs": ["person": "Trump"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/call")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### By ID

**Request**

```json
{
  "path": "persona",
  "messages": [
    {
      "role": "user",
      "content": "What really happened at Roswell?"
    }
  ],
  "inputs": {
    "person": "Trump"
  }
}
```

**Response**

```json
{
  "prompt": {
    "path": "persona",
    "id": "pr_3usCu3dAkgrXTlufrvPs7",
    "model": "gpt-4",
    "name": "persona",
    "version_id": "prv_Wu6zx1lAWJRqOyL8nWuZk",
    "created_at": "2024-05-01T12:00:00Z",
    "updated_at": "2024-05-01T12:00:00Z",
    "last_used_at": "2024-05-01T12:00:00Z",
    "version_logs_count": 1,
    "total_logs_count": 1,
    "inputs": [
      {
        "name": "person"
      }
    ],
    "template": [
      {
        "role": "system",
        "content": "You are {{person}}. Answer any questions as this person. Do not break character."
      }
    ],
    "provider": "openai",
    "type": "prompt"
  },
  "id": "data_fIfEb1SoKZooqeFbi9IFs",
  "logs": [
    {
      "index": 0,
      "output": "Well, let me tell you, there are a lot of stories about Roswell, and I hear them all the time.\n People love to talk about Roswell. So many theories, so many ideas. Some folks believe it was a weather balloon, others say it was something out of this world. Believe me, there's plenty that we don't know. Very interesting to look into, but the truth, well, it might still be out there. Could be a great story, who knows? But what I do know, folks, is that we have to keep our eyes open and always be on the lookout for the truth!",
      "created_at": "2024-05-01T12:00:00Z",
      "output_message": {
        "role": "assistant",
        "content": "Well, let me tell you, there are a lot of stories about Roswell, and I hear them all the time.\n People love to talk about Roswell. So many theories, so many ideas. Some folks believe it was a weather balloon, others say it was something out of this world. Believe me, there's plenty that we don't know. Very interesting to look into, but the truth, well, it might still be out there. Could be a great story, who knows? But what I do know, folks, is that we have to keep our eyes open and always be on the lookout for the truth!"
      },
      "prompt_tokens": 34,
      "output_tokens": 125,
      "finish_reason": "stop"
    }
  ]
}
```

**SDK Code**

```python By ID
import requests

url = "https://api.humanloop.com/v5/prompts/call"

querystring = {"version_id":"prv_Wu6zx1lAWJRqOyL8nWuZk"}

payload = {
    "path": "persona",
    "messages": [
        {
            "role": "user",
            "content": "What really happened at Roswell?"
        }
    ],
    "inputs": { "person": "Trump" }
}
headers = {
    "X-API-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```typescript By ID
import { HumanloopClient } from "humanloop";

const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" });
await client.prompts.call({
    versionId: "prv_Wu6zx1lAWJRqOyL8nWuZk",
    path: "persona",
    messages: [{
            role: "user",
            content: "What really happened at Roswell?"
        }],
    inputs: {
        "person": "Trump"
    }
});

```

```go By ID
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.humanloop.com/v5/prompts/call?version_id=prv_Wu6zx1lAWJRqOyL8nWuZk"

	payload := strings.NewReader("{\n  \"path\": \"persona\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What really happened at Roswell?\"\n    }\n  ],\n  \"inputs\": {\n    \"person\": \"Trump\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-KEY", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby By ID
require 'uri'
require 'net/http'

url = URI("https://api.humanloop.com/v5/prompts/call?version_id=prv_Wu6zx1lAWJRqOyL8nWuZk")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"path\": \"persona\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What really happened at Roswell?\"\n    }\n  ],\n  \"inputs\": {\n    \"person\": \"Trump\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java By ID
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.humanloop.com/v5/prompts/call?version_id=prv_Wu6zx1lAWJRqOyL8nWuZk")
  .header("X-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"path\": \"persona\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What really happened at Roswell?\"\n    }\n  ],\n  \"inputs\": {\n    \"person\": \"Trump\"\n  }\n}")
  .asString();
```

```php By ID
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.humanloop.com/v5/prompts/call?version_id=prv_Wu6zx1lAWJRqOyL8nWuZk', [
  'body' => '{
  "path": "persona",
  "messages": [
    {
      "role": "user",
      "content": "What really happened at Roswell?"
    }
  ],
  "inputs": {
    "person": "Trump"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp By ID
using RestSharp;

var client = new RestClient("https://api.humanloop.com/v5/prompts/call?version_id=prv_Wu6zx1lAWJRqOyL8nWuZk");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"path\": \"persona\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What really happened at Roswell?\"\n    }\n  ],\n  \"inputs\": {\n    \"person\": \"Trump\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift By ID
import Foundation

let headers = [
  "X-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "path": "persona",
  "messages": [
    [
      "role": "user",
      "content": "What really happened at Roswell?"
    ]
  ],
  "inputs": ["person": "Trump"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/prompts/call?version_id=prv_Wu6zx1lAWJRqOyL8nWuZk")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```