Functions
get-certificate
fn (request: GetCertificateRequest): GetCertificateResponse
fn (request: GetCertificateRequest, opts: Map): GetCertificateResponse
GET /organization/certificates/{certificate_id} - Retrieve an organization certificate.
Example
cert ::openai::get/get-certificate({certificate-id: "cert_abc123", include: "content"})
cert.name
cert.certificate_details
get-chat-completion
fn (request: GetChatCompletionRequest): GetChatCompletionResponse
fn (request: GetChatCompletionRequest, opts: Map): GetChatCompletionResponse
GET /chat/completions/{completion_id} - Retrieve a stored chat completion by ID.
Example
completion ::openai::get/get-chat-completion(::openai::get/GetChatCompletionRequest({
completion-id: "chatcmpl_abc123"
}))
completion.choices[0].message.content
get-chat-messages
fn (request: GetChatCompletionMessagesRequest): GetChatCompletionMessagesResponse
fn (request: GetChatCompletionMessagesRequest, opts: Map): GetChatCompletionMessagesResponse
GET /chat/completions/{completion_id}/messages - Retrieve messages from a stored chat completion.
Example
page ::openai::get/get-chat-messages({
completion-id: "chatcmpl_abc123",
limit: "20",
order: "asc"
})
page.data
page.has_more
get-eval
fn (request: GetEvalRequest): GetEvalResponse
fn (request: GetEvalRequest, opts: Map): GetEvalResponse
GET /evals/{eval_id} - Retrieve an evaluation by its ID.
Example
evaluation ::openai::get/get-eval(::openai::get/GetEvalRequest({eval-id: "eval_abc123"}))
evaluation.name
get-eval-run
fn (request: GetEvalRunRequest): GetEvalRunResponse
fn (request: GetEvalRunRequest, opts: Map): GetEvalRunResponse
GET /evals/{eval_id}/runs/{run_id} - Retrieve a specific evaluation run.
Example
eval-run ::openai::get/get-eval-run(::openai::get/GetEvalRunRequest({
eval-id: "eval_abc123",
run-id: "evalrun_abc123"
}))
eval-run.result_counts
get-eval-run-output-items
fn (request: GetEvalRunOutputItemsRequest): GetEvalRunOutputItemsResponse
fn (request: GetEvalRunOutputItemsRequest, opts: Map): GetEvalRunOutputItemsResponse
GET /evals/{eval_id}/runs/{run_id}/output_items - Get eval run output items
Example
page ::openai::get/get-eval-run-output-items({
eval-id: "eval_abc123",
run-id: "evalrun_abc123",
limit: "20",
status: "fail"
})
map(page.data, %.results)
get-eval-runs
fn (request: GetEvalRunsRequest): GetEvalRunsResponse
fn (request: GetEvalRunsRequest, opts: Map): GetEvalRunsResponse
GET /evals/{eval_id}/runs - List all runs for an evaluation.
Example
page ::openai::get/get-eval-runs({eval-id: "eval_abc123", limit: "20", status: "completed"})
map(page.data, %.id)
page.has_more
get-model-response
fn (request: GetResponseRequest): GetResponseResponse
fn (request: GetResponseRequest, opts: Map): GetResponseResponse
GET /responses/{response_id} - Retrieve a model response by ID.
Example
response ::openai::get/get-model-response({response-id: "resp_abc123"})
response.status
response.output
get-output-item-eval-run
fn (request: GetEvalRunOutputItemRequest): GetEvalRunOutputItemResponse
fn (request: GetEvalRunOutputItemRequest, opts: Map): GetEvalRunOutputItemResponse
GET /evals/{eval_id}/runs/{run_id}/output_items/{output_item_id} - Get an output item of an eval run
Example
item ::openai::get/get-output-item-eval-run(::openai::get/GetEvalRunOutputItemRequest({
eval-id: "eval_abc123",
run-id: "evalrun_abc123",
output-item-id: "outputitem_abc123"
}))
item.status
retrieve-assistant
fn (request: GetAssistantRequest): GetAssistantResponse
fn (request: GetAssistantRequest, opts: Map): GetAssistantResponse
GET /assistants/{assistant_id} - Retrieve an assistant by its ID.
Example
assistant ::openai::get/retrieve-assistant(::openai::get/GetAssistantRequest({
assistant-id: "asst_abc123"
}))
assistant.model
retrieve-message
fn (request: GetMessageRequest): GetMessageResponse
fn (request: GetMessageRequest, opts: Map): GetMessageResponse
GET /threads/{thread_id}/messages/{message_id} - Retrieve a specific message from a thread.
Example
message ::openai::get/retrieve-message(::openai::get/GetMessageRequest({
thread-id: "thread_abc123",
message-id: "msg_abc123"
}))
message.content
retrieve-run
fn (request: GetRunRequest): GetRunResponse
fn (request: GetRunRequest, opts: Map): GetRunResponse
GET /threads/{thread_id}/runs/{run_id} - Retrieve the status and details of a run.
Example
run ::openai::get/retrieve-run(::openai::get/GetRunRequest({
thread-id: "thread_abc123",
run-id: "run_abc123"
}))
run.status
retrieve-run-step
fn (request: GetRunStepRequest): GetRunStepResponse
fn (request: GetRunStepRequest, opts: Map): GetRunStepResponse
GET /threads/{thread_id}/runs/{run_id}/steps/{step_id} - Retrieve run step
Example
step ::openai::get/retrieve-run-step({
thread-id: "thread_abc123",
run-id: "run_abc123",
step-id: "step_abc123"
})
step.step_details
retrieve-thread
fn (request: GetThreadRequest): GetThreadResponse
fn (request: GetThreadRequest, opts: Map): GetThreadResponse
GET /threads/{thread_id} - Retrieve a thread by its ID.
Example
thread ::openai::get/retrieve-thread(::openai::get/GetThreadRequest({
thread-id: "thread_abc123"
}))
thread.metadata
retrieve-vector-store
fn (request: GetVectorStoreRequest): GetVectorStoreResponse
fn (request: GetVectorStoreRequest, opts: Map): GetVectorStoreResponse
GET /vector_stores/{vector_store_id} - Retrieve a vector store by its ID.
Example
store ::openai::get/retrieve-vector-store(::openai::get/GetVectorStoreRequest({
vector-store-id: "vs_abc123"
}))
store.file_counts
retrieve-vector-store-file
fn (request: GetVectorStoreFileRequest): GetVectorStoreFileResponse
fn (request: GetVectorStoreFileRequest, opts: Map): GetVectorStoreFileResponse
GET /vector_stores/{vector_store_id}/files/{file_id} - Retrieve vector store file
Example
store-file ::openai::get/retrieve-vector-store-file(::openai::get/GetVectorStoreFileRequest({
vector-store-id: "vs_abc123",
file-id: "file-abc123"
}))
store-file.status
retrieve-vector-store-file-batch
fn (request: GetVectorStoreFileBatchRequest): GetVectorStoreFileBatchResponse
fn (request: GetVectorStoreFileBatchRequest, opts: Map): GetVectorStoreFileBatchResponse
GET /vector_stores/{vector_store_id}/file_batches/{batch_id} - Retrieve vector store file batch
Example
file-batch ::openai::get/retrieve-vector-store-file-batch(::openai::get/GetVectorStoreFileBatchRequest({
vector-store-id: "vs_abc123",
batch-id: "vsfb_abc123"
}))
file-batch.status
Types
AssistantObject
AssistantObject type {
id: Str,
object: "assistant",
created_at: Int,
name: Str?,
description: Str?,
model: Str,
instructions: Str?,
tools: Vec<AssistantTool>,
tool_resources: Map?,
metadata: Metadata?,
temperature: Dec?,
top_p: Dec?,
response_format: AssistantsApiResponseFormatOption?
}
AssistantTool
AssistantTool type Map
AssistantsApiResponseFormatOption
AssistantsApiResponseFormatOption type Any
Certificate
Certificate type {
object: CertificateObjectType,
id: Str,
name: Str?,
created_at: Int,
certificate_details: Map,
active: Bool?
}
CertificateObjectType
CertificateObjectType type "certificate" | "organization.certificate" | "organization.project.certificate"
ChatCompletionMessageList
ChatCompletionMessageList type {
object: "list",
data: Vec,
first_id: Str,
last_id: Str,
has_more: Bool
}
ChunkingStrategyResponse
ChunkingStrategyResponse type Map
CompletionUsage
CompletionUsage type {
completion_tokens: Int,
prompt_tokens: Int,
total_tokens: Int,
completion_tokens_details: Map?,
prompt_tokens_details: Map?
}
CreateChatCompletionResponse
CreateChatCompletionResponse type {
id: Str,
choices: Vec<Map>,
created: Int,
model: Str,
service_tier: ServiceTier?,
system_fingerprint: Str?,
object: "chat.completion",
usage: CompletionUsage?
}
Eval
Eval type {
object: "eval",
id: Str,
name: Str?,
data_source_config: Map,
testing_criteria: Vec,
created_at: Int,
metadata: Metadata?
}
EvalApiError
EvalApiError type {
code: Str?,
message: Str
}
EvalRun
EvalRun type {
object: "eval.run",
id: Str,
eval_id: Str,
status: Str,
model: Str,
name: Str?,
created_at: Int,
report_url: Str?,
result_counts: Map,
per_model_usage: Vec<Map>,
per_testing_criteria_results: Vec<Map>,
data_source: Map,
metadata: Metadata?,
error: EvalApiError?
}
EvalRunList
EvalRunList type {
object: "list",
data: Vec<EvalRun>,
first_id: Str,
last_id: Str,
has_more: Bool
}
EvalRunOutputItem
EvalRunOutputItem type {
object: "eval.run.output_item",
id: Str,
run_id: Str?,
eval_id: Str,
created_at: Int,
status: Str,
datasource_item_id: Int,
datasource_item: Map,
results: Vec<Map>,
sample: Map
}
EvalRunOutputItemList
EvalRunOutputItemList type {
object: "list",
data: Vec<EvalRunOutputItem>,
first_id: Str,
last_id: Str,
has_more: Bool
}
GetAssistantRequest
GetAssistantRequest type {
assistant-id: Str
}
GetAssistantResponse
GetAssistantResponse type {
id: Str,
object: "assistant",
created_at: Int,
name: Str?,
description: Str?,
model: Str,
instructions: Str?,
tools: Vec<AssistantTool>,
tool_resources: Map?,
metadata: Metadata?,
temperature: Dec?,
top_p: Dec?,
response_format: AssistantsApiResponseFormatOption?
}
GetCertificateRequest
GetCertificateRequest type {
certificate-id: Str,
include: Str
}
GetCertificateResponse
GetCertificateResponse type {
object: CertificateObjectType,
id: Str,
name: Str?,
created_at: Int,
certificate_details: Map,
active: Bool?
}
GetChatCompletionMessagesRequest
GetChatCompletionMessagesRequest type {
completion-id: Str,
after: Str,
limit: Str,
order: Str
}
GetChatCompletionMessagesResponse
GetChatCompletionMessagesResponse type {
object: "list",
data: Vec,
first_id: Str?,
last_id: Str?,
has_more: Bool
}
GetChatCompletionRequest
GetChatCompletionRequest type {
completion-id: Str
}
GetChatCompletionResponse
GetChatCompletionResponse type {
id: Str,
choices: Vec<Map>,
created: Int,
model: Str,
service_tier: ServiceTier?,
system_fingerprint: Str?,
object: "chat.completion",
usage: CompletionUsage?
}
GetEvalRequest
GetEvalRequest type {
eval-id: Str
}
GetEvalResponse
GetEvalResponse type {
object: "eval",
id: Str,
name: Str?,
data_source_config: Map,
testing_criteria: Vec,
created_at: Int,
metadata: Metadata?
}
GetEvalRunOutputItemRequest
GetEvalRunOutputItemRequest type {
eval-id: Str,
run-id: Str,
output-item-id: Str
}
GetEvalRunOutputItemResponse
GetEvalRunOutputItemResponse type {
object: "eval.run.output_item",
id: Str,
run_id: Str?,
eval_id: Str,
created_at: Int,
status: Str,
datasource_item_id: Int,
datasource_item: Map,
results: Vec<Map>,
sample: Map
}
GetEvalRunOutputItemsRequest
GetEvalRunOutputItemsRequest type {
eval-id: Str,
run-id: Str,
after: Str,
limit: Str,
status: Str,
order: Str
}
GetEvalRunOutputItemsResponse
GetEvalRunOutputItemsResponse type {
object: "list",
data: Vec<EvalRunOutputItem>,
first_id: Str?,
last_id: Str?,
has_more: Bool
}
GetEvalRunRequest
GetEvalRunRequest type {
eval-id: Str,
run-id: Str
}
GetEvalRunResponse
GetEvalRunResponse type {
object: "eval.run",
id: Str,
eval_id: Str,
status: Str,
model: Str,
name: Str?,
created_at: Int,
report_url: Str?,
result_counts: Map,
per_model_usage: Vec<Map>,
per_testing_criteria_results: Vec<Map>,
data_source: Map,
metadata: Metadata?,
error: EvalApiError?
}
GetEvalRunsRequest
GetEvalRunsRequest type {
eval-id: Str,
after: Str,
limit: Str,
order: Str,
status: Str
}
GetEvalRunsResponse
GetEvalRunsResponse type {
object: "list",
data: Vec<EvalRun>,
first_id: Str?,
last_id: Str?,
has_more: Bool
}
GetMessageRequest
GetMessageRequest type {
thread-id: Str,
message-id: Str
}
GetMessageResponse
GetMessageResponse type {
id: Str,
object: "thread.message",
created_at: Int,
thread_id: Str,
status: MessageStatus,
incomplete_details: Map?,
completed_at: Int?,
incomplete_at: Int?,
role: MessageRole,
content: Vec<MessageContent>,
assistant_id: Str?,
run_id: Str?,
attachments: Vec<Map>?,
metadata: Metadata?
}
GetResponseRequest
GetResponseRequest type {
response-id: Str,
include: Str,
stream: Str,
starting-after: Str,
include-obfuscation: Str
}
GetResponseResponse
GetResponseResponse type Map
GetRunRequest
GetRunRequest type {
thread-id: Str,
run-id: Str
}
GetRunResponse
GetRunResponse type {
id: Str,
object: "thread.run",
created_at: Int,
thread_id: Str,
assistant_id: Str?,
status: RunStatus,
required_action: Map?,
last_error: Map?,
expires_at: Int?,
started_at: Int?,
cancelled_at: Int?,
failed_at: Int?,
completed_at: Int?,
incomplete_details: Map?,
model: Str,
instructions: Str?,
tools: Vec<AssistantTool>,
metadata: Metadata?,
usage: RunCompletionUsage?,
temperature: Dec?,
top_p: Dec?,
max_prompt_tokens: Int?,
max_completion_tokens: Int?,
truncation_strategy: Any,
tool_choice: Any,
parallel_tool_calls: ParallelToolCalls,
response_format: AssistantsApiResponseFormatOption
}
GetRunStepRequest
GetRunStepRequest type {
thread-id: Str,
run-id: Str,
step-id: Str,
include: Str
}
GetRunStepResponse
GetRunStepResponse type {
id: Str,
object: "thread.run.step",
created_at: Int,
assistant_id: Str?,
thread_id: Str,
run_id: Str?,
type: RunStepType,
status: RunStepStatus,
step_details: Map,
last_error: Map?,
expired_at: Int?,
cancelled_at: Int?,
failed_at: Int?,
completed_at: Int?,
metadata: Metadata?,
usage: RunStepCompletionUsage?
}
GetThreadRequest
GetThreadRequest type {
thread-id: Str
}
GetThreadResponse
GetThreadResponse type {
id: Str,
object: "thread",
created_at: Int,
tool_resources: Map?,
metadata: Metadata?
}
GetVectorStoreFileBatchRequest
GetVectorStoreFileBatchRequest type {
vector-store-id: Str,
batch-id: Str
}
GetVectorStoreFileBatchResponse
GetVectorStoreFileBatchResponse type {
id: Str,
object: "vector_store.files_batch",
created_at: Int,
vector_store_id: Str,
status: VectorStoreFileStatus,
file_counts: Map
}
GetVectorStoreFileRequest
GetVectorStoreFileRequest type {
vector-store-id: Str,
file-id: Str
}
GetVectorStoreFileResponse
GetVectorStoreFileResponse type {
id: Str,
object: "vector_store.file",
usage_bytes: Int,
created_at: Int,
vector_store_id: Str,
status: VectorStoreFileStatus,
last_error: Map?,
chunking_strategy: ChunkingStrategyResponse?,
attributes: VectorStoreFileAttributes?
}
GetVectorStoreRequest
GetVectorStoreRequest type {
vector-store-id: Str
}
GetVectorStoreResponse
GetVectorStoreResponse type {
id: Str,
object: "vector_store",
created_at: Int,
name: Str?,
usage_bytes: Int,
file_counts: Map,
status: VectorStoreStatus,
expires_after: VectorStoreExpirationAfter?,
expires_at: Int?,
last_active_at: Int?,
metadata: Metadata?
}
MessageContent
MessageContent type Any
MessageObject
MessageObject type {
id: Str,
object: "thread.message",
created_at: Int,
thread_id: Str,
status: MessageStatus,
incomplete_details: Map?,
completed_at: Int?,
incomplete_at: Int?,
role: MessageRole,
content: Vec<MessageContent>,
assistant_id: Str?,
run_id: Str?,
attachments: Vec<Map>?,
metadata: Metadata?
}
MessageRole
MessageRole type "user" | "assistant"
MessageStatus
MessageStatus type "in_progress" | "incomplete" | "completed"
Metadata
Metadata type Map
ParallelToolCalls
ParallelToolCalls type Bool
Response
Response type Map
RunCompletionUsage
RunCompletionUsage type {
completion_tokens: Int,
prompt_tokens: Int,
total_tokens: Int
}
RunObject
RunObject type {
id: Str,
object: "thread.run",
created_at: Int,
thread_id: Str,
assistant_id: Str?,
status: RunStatus,
required_action: Map?,
last_error: Map?,
expires_at: Int?,
started_at: Int?,
cancelled_at: Int?,
failed_at: Int?,
completed_at: Int?,
incomplete_details: Map?,
model: Str,
instructions: Str?,
tools: Vec<AssistantTool>,
metadata: Metadata?,
usage: RunCompletionUsage?,
temperature: Dec?,
top_p: Dec?,
max_prompt_tokens: Int?,
max_completion_tokens: Int?,
truncation_strategy: Any,
tool_choice: Any,
parallel_tool_calls: ParallelToolCalls,
response_format: AssistantsApiResponseFormatOption
}
RunStatus
RunStatus type Str
RunStepCompletionUsage
RunStepCompletionUsage type {
completion_tokens: Int,
prompt_tokens: Int,
total_tokens: Int
}
RunStepObject
RunStepObject type {
id: Str,
object: "thread.run.step",
created_at: Int,
assistant_id: Str?,
thread_id: Str,
run_id: Str?,
type: RunStepType,
status: RunStepStatus,
step_details: Map,
last_error: Map?,
expired_at: Int?,
cancelled_at: Int?,
failed_at: Int?,
completed_at: Int?,
metadata: Metadata?,
usage: RunStepCompletionUsage?
}
RunStepStatus
RunStepStatus type "in_progress" | "cancelled" | "failed" | "completed" | "expired"
RunStepType
RunStepType type "message_creation" | "tool_calls"
ServiceTier
ServiceTier type Str
ThreadObject
ThreadObject type {
id: Str,
object: "thread",
created_at: Int,
tool_resources: Map,
metadata: Metadata?
}
VectorStoreExpirationAfter
VectorStoreExpirationAfter type {
anchor: "last_active_at",
days: Int
}
VectorStoreFileAttributes
VectorStoreFileAttributes type Map
VectorStoreFileBatchObject
VectorStoreFileBatchObject type {
id: Str,
object: "vector_store.files_batch",
created_at: Int,
vector_store_id: Str,
status: VectorStoreFileStatus,
file_counts: Map
}
VectorStoreFileObject
VectorStoreFileObject type {
id: Str,
object: "vector_store.file",
usage_bytes: Int,
created_at: Int,
vector_store_id: Str,
status: VectorStoreFileStatus,
last_error: Map?,
chunking_strategy: ChunkingStrategyResponse?,
attributes: VectorStoreFileAttributes?
}
VectorStoreFileStatus
VectorStoreFileStatus type "in_progress" | "completed" | "cancelled" | "failed"
VectorStoreObject
VectorStoreObject type {
id: Str,
object: "vector_store",
created_at: Int,
name: Str?,
usage_bytes: Int,
file_counts: Map,
status: VectorStoreStatus,
expires_after: VectorStoreExpirationAfter?,
expires_at: Int?,
last_active_at: Int?,
metadata: Metadata?
}
VectorStoreStatus
VectorStoreStatus type "expired" | "in_progress" | "completed"