Python
import os
from meibel import MeibelClient
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
response = client.batches.list()
for batch_definition in response.data:
print(f"{batch_definition.id}: {batch_definition.name} (v{batch_definition.version})")
print(f"Total: {response.pagination.total}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const response = await client.batches.list();
for (const batchDefinition of response.data) {
console.log(`${batchDefinition.name} (${batchDefinition.version}) - ${batchDefinition.id}`);
}
console.log(`Total: ${response.pagination.total}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
resp, err := client.Batches.List(context.Background())
if err != nil {
panic(err)
}
for _, def := range resp.Data {
fmt.Printf("%s - %s (v%s)\n", def.ID, def.Name, def.Version)
}
fmt.Printf("Total: %d\n", resp.Pagination.Total)
}curl --request GET \
--url https://api.meibel.ai/v2/batch-definitions \
--header 'Meibel-API-Key: <api-key>'const options = {method: 'GET', headers: {'Meibel-API-Key': '<api-key>'}};
fetch('https://api.meibel.ai/v2/batch-definitions', 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.meibel.ai/v2/batch-definitions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.meibel.ai/v2/batch-definitions")
.header("Meibel-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/batch-definitions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Meibel-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"customer_id": "<string>",
"project_id": "<string>",
"name": "<string>",
"version": "<string>",
"parent_version": "<string>",
"catalog_urn": "<string>",
"agent_urn": "<string>",
"agent_spec_json": {},
"input_datasource_id": "<string>",
"concurrency": 123,
"retry_limit": 123,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"filters": {},
"output_datasource_id": "<string>",
"user_message": "<string>",
"recurrence_cron": "<string>",
"description": "<string>",
"execution_policy": {
"datasources": {},
"tools": {}
},
"execution_policy_ids": [
"<string>"
],
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"total": 123,
"offset": 123,
"limit": 123
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Batches
List Batch Definitions
GET
/
batch-definitions
Python
import os
from meibel import MeibelClient
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
response = client.batches.list()
for batch_definition in response.data:
print(f"{batch_definition.id}: {batch_definition.name} (v{batch_definition.version})")
print(f"Total: {response.pagination.total}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const response = await client.batches.list();
for (const batchDefinition of response.data) {
console.log(`${batchDefinition.name} (${batchDefinition.version}) - ${batchDefinition.id}`);
}
console.log(`Total: ${response.pagination.total}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
resp, err := client.Batches.List(context.Background())
if err != nil {
panic(err)
}
for _, def := range resp.Data {
fmt.Printf("%s - %s (v%s)\n", def.ID, def.Name, def.Version)
}
fmt.Printf("Total: %d\n", resp.Pagination.Total)
}curl --request GET \
--url https://api.meibel.ai/v2/batch-definitions \
--header 'Meibel-API-Key: <api-key>'const options = {method: 'GET', headers: {'Meibel-API-Key': '<api-key>'}};
fetch('https://api.meibel.ai/v2/batch-definitions', 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.meibel.ai/v2/batch-definitions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.meibel.ai/v2/batch-definitions")
.header("Meibel-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/batch-definitions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Meibel-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"customer_id": "<string>",
"project_id": "<string>",
"name": "<string>",
"version": "<string>",
"parent_version": "<string>",
"catalog_urn": "<string>",
"agent_urn": "<string>",
"agent_spec_json": {},
"input_datasource_id": "<string>",
"concurrency": 123,
"retry_limit": 123,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"filters": {},
"output_datasource_id": "<string>",
"user_message": "<string>",
"recurrence_cron": "<string>",
"description": "<string>",
"execution_policy": {
"datasources": {},
"tools": {}
},
"execution_policy_ids": [
"<string>"
],
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"total": 123,
"offset": 123,
"limit": 123
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Query Parameters
Required range:
x >= 0Required range:
1 <= x <= 500Was this page helpful?
⌘I