cURL
curl --request GET \
--url https://api.tela.com/v2/chat/completions/{id}import requests
url = "https://api.tela.com/v2/chat/completions/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.tela.com/v2/chat/completions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tela.com/v2/chat/completions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tela.com/v2/chat/completions/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tela.com/v2/chat/completions/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tela.com/v2/chat/completions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "created",
"input_content": {
"variables": {},
"messages": [
{
"role": "<string>",
"content": "<string>",
"function_call": {
"name": "<string>",
"arguments": "<string>"
}
}
],
"files": [
{
"name": "<string>",
"used_at": "variables",
"parsed_content": "<string>",
"url": "<string>",
"type": "image"
}
]
},
"output_content": {
"role": "system",
"tool_calls": [
{
"name": "<string>",
"arguments": "<string>"
}
],
"information": {
"duration": 123,
"cost": 123,
"input_tokens": 123,
"output_tokens": 123
},
"has_structured_output": true,
"content": {},
"input_messages": "<string>"
},
"raw_input": {
"version_id": "<string>",
"canvas_id": "<string>",
"application_id": "<string>",
"webhook_url": "<string>",
"variables": {},
"messages": [
{
"role": "user",
"content": "<string>"
}
],
"override": {
"type": "chat",
"model": "<string>",
"temperature": 123,
"functions": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"parameters": {
"type": "object",
"properties": {},
"required": [
"<string>"
]
}
}
],
"structured_output": {
"enabled": true,
"schema": {
"properties": {},
"type": "object",
"title": "<string>",
"description": "<string>",
"required": [
"<string>"
]
}
}
}
},
"raw_output": {},
"compatibility_date": "2023-11-07T05:31:56Z",
"prompt_version_id": "<string>",
"prompt_application_id": "<string>",
"workspace_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Completions
Retrieve Canvas Run
Retrieve the status and details of an asynchronous chat completion using its unique identifier, enabling efficient polling and status monitoring.
GET
/
v2
/
chat
/
completions
/
{id}
cURL
curl --request GET \
--url https://api.tela.com/v2/chat/completions/{id}import requests
url = "https://api.tela.com/v2/chat/completions/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.tela.com/v2/chat/completions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tela.com/v2/chat/completions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tela.com/v2/chat/completions/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tela.com/v2/chat/completions/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tela.com/v2/chat/completions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "created",
"input_content": {
"variables": {},
"messages": [
{
"role": "<string>",
"content": "<string>",
"function_call": {
"name": "<string>",
"arguments": "<string>"
}
}
],
"files": [
{
"name": "<string>",
"used_at": "variables",
"parsed_content": "<string>",
"url": "<string>",
"type": "image"
}
]
},
"output_content": {
"role": "system",
"tool_calls": [
{
"name": "<string>",
"arguments": "<string>"
}
],
"information": {
"duration": 123,
"cost": 123,
"input_tokens": 123,
"output_tokens": 123
},
"has_structured_output": true,
"content": {},
"input_messages": "<string>"
},
"raw_input": {
"version_id": "<string>",
"canvas_id": "<string>",
"application_id": "<string>",
"webhook_url": "<string>",
"variables": {},
"messages": [
{
"role": "user",
"content": "<string>"
}
],
"override": {
"type": "chat",
"model": "<string>",
"temperature": 123,
"functions": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"parameters": {
"type": "object",
"properties": {},
"required": [
"<string>"
]
}
}
],
"structured_output": {
"enabled": true,
"schema": {
"properties": {},
"type": "object",
"title": "<string>",
"description": "<string>",
"required": [
"<string>"
]
}
}
}
},
"raw_output": {},
"compatibility_date": "2023-11-07T05:31:56Z",
"prompt_version_id": "<string>",
"prompt_application_id": "<string>",
"workspace_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Response
200 - application/json
Successful retrieval of chat completion
Response structure for a chat completion webhook. This represents the data sent to the webhook URL when a chat completion is finished.
The current status of the chat completion. 'created' means the request has been received but processing hasn't started. 'running' means the chat completion is currently being processed. 'succeeded' means the chat completion has finished successfully. 'failed' means the chat completion encountered an error and couldn't complete.
Available options:
created, failed, running, succeeded