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.
Copy to LLMGithubGo to App
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
    • Overview
  • Python SDK
    • Reference
    • REST API Client
  • Typescript SDK
    • Overview
    • Opik TS
    • Prompts
    • Opik Query Language (OQL)
  • Rest API
    • Overview
        • POSTCreate chat completions
LogoLogo
Copy to LLMGithubGo to App
Rest APIAPI ReferenceChat Completions

Create chat completions

POST
/v1/private/chat/completions
POST
/api/v1/private/chat/completions
$curl -X POST http://localhost:5173/api/v1/private/chat/completions \
> -H "Content-Type: application/json" \
> -d '{}'
200Successful
1{
2 "id": "string",
3 "created": 1,
4 "model": "string",
5 "choices": [
6 {
7 "index": 1,
8 "message": {
9 "role": "system",
10 "content": "string",
11 "reasoning_content": "string",
12 "name": "string",
13 "tool_calls": [
14 {
15 "id": "string",
16 "index": 1,
17 "type": "function",
18 "function": {
19 "name": "string",
20 "arguments": "string"
21 }
22 }
23 ],
24 "refusal": "string",
25 "function_call": {
26 "name": "string",
27 "arguments": "string"
28 }
29 },
30 "delta": {
31 "role": "string",
32 "content": "string",
33 "reasoning_content": "string",
34 "tool_calls": [
35 {
36 "id": "string",
37 "index": 1,
38 "type": "function",
39 "function": {
40 "name": "string",
41 "arguments": "string"
42 }
43 }
44 ],
45 "function_call": {
46 "name": "string",
47 "arguments": "string"
48 }
49 },
50 "finish_reason": "string",
51 "logprobs": {
52 "content": [
53 {
54 "token": "string",
55 "logprob": 1.1,
56 "bytes": [
57 1
58 ]
59 }
60 ]
61 }
62 }
63 ],
64 "usage": {
65 "total_tokens": 1,
66 "prompt_tokens": 1,
67 "prompt_tokens_details": {
68 "cached_tokens": 1
69 },
70 "completion_tokens": 1,
71 "completion_tokens_details": {
72 "reasoning_tokens": 1
73 }
74 },
75 "system_fingerprint": "string",
76 "service_tier": "string"
77}
Create chat completions
Was this page helpful?
Previous

Find dashboards

Next
Built with

Request

This endpoint expects an object.
modelstringOptional
messageslist of objectsOptional
temperaturedoubleOptional
top_pdoubleOptional
nintegerOptional
streambooleanOptional
stream_optionsobjectOptional
stoplist of stringsOptional
max_tokensintegerOptional
max_completion_tokensintegerOptional
presence_penaltydoubleOptional
frequency_penaltydoubleOptional
logit_biasmap from strings to integersOptional
userstringOptional
response_formatobjectOptional
seedintegerOptional
toolslist of objectsOptional
tool_choiceobjectOptional
parallel_tool_callsbooleanOptional
storebooleanOptional
metadatamap from strings to stringsOptional
reasoning_effortstringOptional
service_tierstringOptional
logprobsbooleanOptional
top_logprobsintegerOptional
functionslist of objectsOptional
function_callobjectOptional

Response

Chat completions response
idstring
createdlong
modelstring
choiceslist of objects
usageobject
system_fingerprintstring
service_tierstring