Create a thread
curl --request POST \
--url https://api.matrices.com/v1/agents/{agentId}/threads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": [
{
"text": "<string>",
"type": "text"
}
],
"maxCost": 1,
"model": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({content: [{text: '<string>', type: 'text'}], maxCost: 1, model: '<string>'})
};
fetch('https://api.matrices.com/v1/agents/{agentId}/threads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.matrices.com/v1/agents/{agentId}/threads"
payload = {
"content": [
{
"text": "<string>",
"type": "text"
}
],
"maxCost": 1,
"model": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.matrices.com/v1/agents/{agentId}/threads"
payload := strings.NewReader("{\n \"content\": [\n {\n \"text\": \"<string>\",\n \"type\": \"text\"\n }\n ],\n \"maxCost\": 1,\n \"model\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "running",
"threadId": "<string>",
"turnId": "<string>"
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}Threads
Create a thread
POST
/
v1
/
agents
/
{agentId}
/
threads
Create a thread
curl --request POST \
--url https://api.matrices.com/v1/agents/{agentId}/threads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": [
{
"text": "<string>",
"type": "text"
}
],
"maxCost": 1,
"model": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({content: [{text: '<string>', type: 'text'}], maxCost: 1, model: '<string>'})
};
fetch('https://api.matrices.com/v1/agents/{agentId}/threads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.matrices.com/v1/agents/{agentId}/threads"
payload = {
"content": [
{
"text": "<string>",
"type": "text"
}
],
"maxCost": 1,
"model": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.matrices.com/v1/agents/{agentId}/threads"
payload := strings.NewReader("{\n \"content\": [\n {\n \"text\": \"<string>\",\n \"type\": \"text\"\n }\n ],\n \"maxCost\": 1,\n \"model\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "running",
"threadId": "<string>",
"turnId": "<string>"
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}{
"error": "<string>",
"message": "<string>",
"attemptsRemaining": 123,
"code": "<string>",
"retryAfterSeconds": 123
}Authorizations
APIKeyBearerAgentLeaseBearer
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Identifies one submission attempt. Retrying with the same key returns the original admission with Idempotent-Replayed: true. Use a new key after changing any request field.
Path Parameters
Body
application/json
Ordered message content, bounded to 512 KiB of encoded JSON. At most 20 image blocks are permitted and image IDs must be unique within the message.
Required array length:
1 - 40 elements- Option 1
- Option 2
Show child attributes
Show child attributes
Optional USD cost cap for the thread.
Required range:
x >= 0Optional concrete catalog model id selected from the target agent profile; wildcard selectors are not accepted. Defaults to the profile's preferred model.
Pattern:
^[^*]+$