Skip to content

Commit b1cfe23

Browse files
authored
Michelle/api ref correction (#505)
* corrected llm gateway usage response * corrected llm gateway usage response in API ref * fixed cerebras param
1 parent d9b809a commit b1cfe23

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

fern/pages/07-llm-gateway/agentic-workflows.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ The API returns a JSON response. In agentic workflows, the model may make multip
189189
"max_tokens": 1000
190190
},
191191
"usage": {
192-
"prompt_tokens": 150,
193-
"completion_tokens": 30,
192+
"input_tokens": 150,
193+
"output_tokens": 30,
194194
"total_tokens": 180
195195
}
196196
}
@@ -227,8 +227,8 @@ After adding the function result to conversation history:
227227
"max_tokens": 1000
228228
},
229229
"usage": {
230-
"prompt_tokens": 220,
231-
"completion_tokens": 35,
230+
"input_tokens": 220,
231+
"output_tokens": 35,
232232
"total_tokens": 255
233233
}
234234
}
@@ -255,8 +255,8 @@ After all tool calls are complete:
255255
"max_tokens": 1000
256256
},
257257
"usage": {
258-
"prompt_tokens": 280,
259-
"completion_tokens": 20,
258+
"input_tokens": 280,
259+
"output_tokens": 20,
260260
"total_tokens": 300
261261
}
262262
}
@@ -275,8 +275,8 @@ After all tool calls are complete:
275275
| `choices[i].tool_calls` | array | Present when the model wants to call tools. Contains function call objects. |
276276
| `request` | object | Echo of the request parameters (excluding `messages`). |
277277
| `usage` | object | Token usage statistics for the request. |
278-
| `usage.prompt_tokens` | number | Number of tokens in the prompt. |
279-
| `usage.completion_tokens` | number | Number of tokens in the completion. |
278+
| `usage.input_tokens` | number | Number of tokens in the prompt. |
279+
| `usage.output_tokens` | number | Number of tokens in the completion. |
280280
| `usage.total_tokens` | number | Total tokens used (prompt + completion). |
281281

282282
#### Tool call object

fern/pages/07-llm-gateway/chat-completions.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ The API returns a JSON response with the model's completion:
136136
"max_tokens": 1000
137137
},
138138
"usage": {
139-
"prompt_tokens": 15,
140-
"completion_tokens": 8,
139+
"input_tokens": 15,
140+
"output_tokens": 8,
141141
"total_tokens": 23
142142
}
143143
}
@@ -155,8 +155,8 @@ The API returns a JSON response with the model's completion:
155155
| `choices[i].finish_reason` | string | The reason the model stopped generating. Common values: `"stop"`, `"length"`. |
156156
| `request` | object | Echo of the request parameters (excluding `prompt` and `messages`). |
157157
| `usage` | object | Token usage statistics for the request. |
158-
| `usage.prompt_tokens` | number | Number of tokens in the prompt. |
159-
| `usage.completion_tokens` | number | Number of tokens in the completion. |
158+
| `usage.input_tokens` | number | Number of tokens in the prompt. |
159+
| `usage.output_tokens` | number | Number of tokens in the completion. |
160160
| `usage.total_tokens` | number | Total tokens used (prompt + completion). |
161161

162162
### Error response

fern/pages/07-llm-gateway/conversations.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ The API returns a JSON response with the model's completion:
201201
"max_tokens": 1000
202202
},
203203
"usage": {
204-
"prompt_tokens": 45,
205-
"completion_tokens": 35,
204+
"input_tokens": 45,
205+
"output_tokens": 35,
206206
"total_tokens": 80
207207
}
208208
}
@@ -220,8 +220,8 @@ The API returns a JSON response with the model's completion:
220220
| `choices[i].finish_reason` | string | The reason the model stopped generating. Common values: `"stop"`, `"length"`. |
221221
| `request` | object | Echo of the request parameters (excluding `messages`). |
222222
| `usage` | object | Token usage statistics for the request. |
223-
| `usage.prompt_tokens` | number | Number of tokens in the prompt. |
224-
| `usage.completion_tokens` | number | Number of tokens in the completion. |
223+
| `usage.input_tokens` | number | Number of tokens in the prompt. |
224+
| `usage.output_tokens` | number | Number of tokens in the completion. |
225225
| `usage.total_tokens` | number | Total tokens used (prompt + completion). |
226226

227227
### Error response

fern/pages/07-llm-gateway/tool-calling.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ The API returns a JSON response. When the model wants to call a tool:
241241
"max_tokens": 1000
242242
},
243243
"usage": {
244-
"prompt_tokens": 120,
245-
"completion_tokens": 25,
244+
"input_tokens": 120,
245+
"output_tokens": 25,
246246
"total_tokens": 145
247247
}
248248
}
@@ -261,8 +261,8 @@ The API returns a JSON response. When the model wants to call a tool:
261261
| `choices[i].tool_calls` | array | Present when the model wants to call tools. Contains function call objects. |
262262
| `request` | object | Echo of the request parameters (excluding `messages`). |
263263
| `usage` | object | Token usage statistics for the request. |
264-
| `usage.prompt_tokens` | number | Number of tokens in the prompt. |
265-
| `usage.completion_tokens` | number | Number of tokens in the completion. |
264+
| `usage.input_tokens` | number | Number of tokens in the prompt. |
265+
| `usage.output_tokens` | number | Number of tokens in the completion. |
266266
| `usage.total_tokens` | number | Total tokens used (prompt + completion). |
267267

268268
#### Tool call object

llm-gateway.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,15 +367,15 @@ components:
367367
Usage:
368368
type: object
369369
properties:
370-
prompt_tokens:
370+
input_tokens:
371371
type: integer
372-
completion_tokens:
372+
output_tokens:
373373
type: integer
374374
total_tokens:
375375
type: integer
376376
required:
377-
- prompt_tokens
378-
- completion_tokens
377+
- input_tokens
378+
- output_tokens
379379
- total_tokens
380380

381381
# Understanding Request/Response Schemas

0 commit comments

Comments
 (0)