For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inBook a demo
DocsReferenceChangelog
DocsReferenceChangelog
  • Introduction
    • SDKs
    • Errors
  • Humanloop API
      • STREAMChat
      • STREAMChat Deployed
      • STREAMChat Model Config
      • STREAMCreate Experiment Stream
LogoLogo
Sign inBook a demo
Humanloop APIChats

Create Experiment

POST
https://api.humanloop.com/v4/chat-experiment
POST
/v4/chat-experiment
$curl -X POST https://api.humanloop.com/v4/chat-experiment
200Successful
1{
2 "data": [
3 {
4 "id": "id",
5 "index": 1,
6 "output": "output",
7 "raw_output": "raw_output",
8 "model_config_id": "model_config_id",
9 "output_message": {
10 "role": "user"
11 },
12 "inputs": {
13 "key": "value"
14 },
15 "finish_reason": "finish_reason",
16 "tool_results": [
17 {
18 "id": "id",
19 "name": "name",
20 "signature": "signature",
21 "result": "result"
22 }
23 ],
24 "messages": [
25 {
26 "role": "user"
27 }
28 ],
29 "tool_calls": [
30 {
31 "id": "id",
32 "type": "function",
33 "function": {
34 "name": "name"
35 }
36 }
37 ],
38 "tool_call": {
39 "name": "name"
40 }
41 }
42 ],
43 "provider_responses": [
44 {
45 "key": "value"
46 }
47 ],
48 "project_id": "project_id",
49 "num_samples": 1,
50 "logprobs": 1,
51 "suffix": "suffix",
52 "user": "user",
53 "usage": {
54 "prompt_tokens": 1,
55 "generation_tokens": 1,
56 "total_tokens": 1,
57 "reasoning_tokens": 1
58 },
59 "metadata": {
60 "key": "value"
61 },
62 "provider_request": {
63 "key": "value"
64 },
65 "session_id": "session_id",
66 "tool_choice": "none"
67}
Was this page helpful?
Previous

Create Experiment Stream

Next
Built with

Response

datalist of objects
Array containing the chat responses.
provider_responseslist of any
The raw responses returned by the model provider.
project_idstring
Unique identifier of the parent project. Will not be provided if the request was made without providing a project name or id
num_samplesintegerDefaults to 1
The number of chat responses.
logprobsinteger

Include the log probabilities of the top n tokens in the provider_response

suffixstring
The suffix that comes after a completion of inserted text. Useful for completions that act like inserts.
userstring

End-user ID passed through to provider call.

usageobject
Counts of the number of tokens used and related stats.
metadatamap from strings to any
Any additional metadata to record.
provider_requestmap from strings to any
The raw request sent to the model provider.
session_idstring
ID of the session if it belongs to one.
tool_choice"none" or "auto" or "required" or object

Controls how the model uses tools. The following options are supported: ‘none’ forces the model to not call a tool; the default when no tools are provided as part of the model config. ‘auto’ the model can decide to call one of the provided tools; the default when tools are provided as part of the model config. Providing {‘type’: ‘function’, ‘function’: {name’: <TOOL_NAME>}} forces the model to use the named function.