Skip to main content
POST
/
api
/
v1
/
llm
/
evals
/
suites
/
{suite_id}
/
versions
Python (SDK)
from meetkai_mka1 import SDK, models


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.llm.evals.create_suite_version(suite_id="eval_suite_aa87e2b1112a455b8deabed784372198", manifest={
        "tasks": [
            models.EvalTask(
                id="spanish_qa",
                type="custom",
                dataset=models.EvalDataset(
                    source="huggingface",
                    path="IIC/AQuAS",
                    split="test",
                ),
                prompt_template="Responde usando el contexto.\n\nContexto: {{context}}\n\nPregunta: {{question}}\n\nRespuesta:",
                target_template="{{answer}}",
                grader=models.EvalPythonGrader(
                    contract="model_backed",
                    model_access="mka1",
                    file_id="file_grader123",
                ),
                preprocess=models.EvalPythonPreprocessor(
                    source="def transform(row):\n    return row\n",
                ),
                num_fewshot=1,
            ),
        ],
    }, make_active=True)

    # Handle response
    print(res)
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.evals.createSuiteVersion({
    suiteId: "eval_suite_aa87e2b1112a455b8deabed784372198",
    createEvalSuiteVersionRequest: {
      manifest: {
        tasks: [
          {
            id: "spanish_qa",
            type: "custom",
            dataset: {
              source: "huggingface",
              path: "IIC/AQuAS",
              split: "test",
            },
            promptTemplate: "Responde usando el contexto.\n\nContexto: {{context}}\n\nPregunta: {{question}}\n\nRespuesta:",
            targetTemplate: "{{answer}}",
            grader: {
              type: "python",
              contract: "model_backed",
              modelAccess: "mka1",
              fileId: "file_grader123",
            },
            preprocess: {
              type: "python",
              source: "def transform(row):\n    return row\n",
            },
            numFewshot: 1,
          },
        ],
      },
    },
  });

  console.log(result);
}

run();
using MeetKai.MKA1;
using MeetKai.MKA1.Types.Components;
using System.Collections.Generic;

var sdk = new SDK(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

var res = await sdk.Llm.Evals.CreateSuiteVersionAsync(
    suiteId: "eval_suite_aa87e2b1112a455b8deabed784372198",
    body: new MeetKai.MKA1.Types.Components.CreateEvalSuiteVersionRequest() {
        Manifest = new EvalSuiteManifest() {
            Tasks = new List<EvalTask>() {
                new EvalTask() {
                    Id = "spanish_qa",
                    Type = EvalTaskType.Custom,
                    Dataset = new EvalDataset() {
                        Source = EvalDatasetSource.Huggingface,
                        Path = "IIC/AQuAS",
                        Split = "test",
                    },
                    PromptTemplate = @"Responde usando el contexto.

                    Contexto: {{context}}

                    Pregunta: {{question}}

                    Respuesta:",
                    TargetTemplate = "{{answer}}",
                    Grader = new EvalPythonGrader() {
                        Contract = EvalPythonGraderContract.ModelBacked,
                        ModelAccess = EvalPythonGraderModelAccess.Mka1,
                        FileId = "file_grader123",
                    },
                    Preprocess = new EvalPythonPreprocessor() {
                        Source = @"def transform(row):
                            return row
                        ",
                    },
                    NumFewshot = 1,
                },
            },
        },
    }
);

// handle response
curl --request POST \
  --url https://apigw.mka1.com/api/v1/llm/evals/suites/{suite_id}/versions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "manifest": {
    "schema_version": "2026-05-27",
    "tasks": [
      {
        "id": "spanish_qa",
        "type": "custom",
        "dataset": {
          "source": "huggingface",
          "path": "IIC/AQuAS",
          "split": "test"
        },
        "num_fewshot": 1,
        "prompt_template": "Responde usando el contexto.\n\nContexto: {{context}}\n\nPregunta: {{question}}\n\nRespuesta:",
        "target_template": "{{answer}}",
        "preprocess": {
          "type": "python",
          "source": "def transform(row):\n    return row\n"
        },
        "grader": {
          "type": "python",
          "contract": "model_backed",
          "model_access": "mka1",
          "file_id": "file_grader123",
          "timeout_seconds": 120
        }
      }
    ]
  },
  "make_active": true
}
'
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    manifest: {
      schema_version: '2026-05-27',
      tasks: [
        {
          id: 'spanish_qa',
          type: 'custom',
          dataset: {source: 'huggingface', path: 'IIC/AQuAS', split: 'test'},
          num_fewshot: 1,
          prompt_template: 'Responde usando el contexto.\n\nContexto: {{context}}\n\nPregunta: {{question}}\n\nRespuesta:',
          target_template: '{{answer}}',
          preprocess: {type: 'python', source: 'def transform(row):\n    return row\n'},
          grader: {
            type: 'python',
            contract: 'model_backed',
            model_access: 'mka1',
            file_id: 'file_grader123',
            timeout_seconds: 120
          }
        }
      ]
    },
    make_active: true
  })
};

fetch('https://apigw.mka1.com/api/v1/llm/evals/suites/{suite_id}/versions', 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://apigw.mka1.com/api/v1/llm/evals/suites/{suite_id}/versions",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'manifest' => [
        'schema_version' => '2026-05-27',
        'tasks' => [
                [
                                'id' => 'spanish_qa',
                                'type' => 'custom',
                                'dataset' => [
                                                                'source' => 'huggingface',
                                                                'path' => 'IIC/AQuAS',
                                                                'split' => 'test'
                                ],
                                'num_fewshot' => 1,
                                'prompt_template' => 'Responde usando el contexto.

Contexto: {{context}}

Pregunta: {{question}}

Respuesta:',
                                'target_template' => '{{answer}}',
                                'preprocess' => [
                                                                'type' => 'python',
                                                                'source' => 'def transform(row):
    return row
'
                                ],
                                'grader' => [
                                                                'type' => 'python',
                                                                'contract' => 'model_backed',
                                                                'model_access' => 'mka1',
                                                                'file_id' => 'file_grader123',
                                                                'timeout_seconds' => 120
                                ]
                ]
        ]
    ],
    'make_active' => true
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://apigw.mka1.com/api/v1/llm/evals/suites/{suite_id}/versions"

	payload := strings.NewReader("{\n  \"manifest\": {\n    \"schema_version\": \"2026-05-27\",\n    \"tasks\": [\n      {\n        \"id\": \"spanish_qa\",\n        \"type\": \"custom\",\n        \"dataset\": {\n          \"source\": \"huggingface\",\n          \"path\": \"IIC/AQuAS\",\n          \"split\": \"test\"\n        },\n        \"num_fewshot\": 1,\n        \"prompt_template\": \"Responde usando el contexto.\\n\\nContexto: {{context}}\\n\\nPregunta: {{question}}\\n\\nRespuesta:\",\n        \"target_template\": \"{{answer}}\",\n        \"preprocess\": {\n          \"type\": \"python\",\n          \"source\": \"def transform(row):\\n    return row\\n\"\n        },\n        \"grader\": {\n          \"type\": \"python\",\n          \"contract\": \"model_backed\",\n          \"model_access\": \"mka1\",\n          \"file_id\": \"file_grader123\",\n          \"timeout_seconds\": 120\n        }\n      }\n    ]\n  },\n  \"make_active\": true\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))

}
HttpResponse<String> response = Unirest.post("https://apigw.mka1.com/api/v1/llm/evals/suites/{suite_id}/versions")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"manifest\": {\n    \"schema_version\": \"2026-05-27\",\n    \"tasks\": [\n      {\n        \"id\": \"spanish_qa\",\n        \"type\": \"custom\",\n        \"dataset\": {\n          \"source\": \"huggingface\",\n          \"path\": \"IIC/AQuAS\",\n          \"split\": \"test\"\n        },\n        \"num_fewshot\": 1,\n        \"prompt_template\": \"Responde usando el contexto.\\n\\nContexto: {{context}}\\n\\nPregunta: {{question}}\\n\\nRespuesta:\",\n        \"target_template\": \"{{answer}}\",\n        \"preprocess\": {\n          \"type\": \"python\",\n          \"source\": \"def transform(row):\\n    return row\\n\"\n        },\n        \"grader\": {\n          \"type\": \"python\",\n          \"contract\": \"model_backed\",\n          \"model_access\": \"mka1\",\n          \"file_id\": \"file_grader123\",\n          \"timeout_seconds\": 120\n        }\n      }\n    ]\n  },\n  \"make_active\": true\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://apigw.mka1.com/api/v1/llm/evals/suites/{suite_id}/versions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"manifest\": {\n    \"schema_version\": \"2026-05-27\",\n    \"tasks\": [\n      {\n        \"id\": \"spanish_qa\",\n        \"type\": \"custom\",\n        \"dataset\": {\n          \"source\": \"huggingface\",\n          \"path\": \"IIC/AQuAS\",\n          \"split\": \"test\"\n        },\n        \"num_fewshot\": 1,\n        \"prompt_template\": \"Responde usando el contexto.\\n\\nContexto: {{context}}\\n\\nPregunta: {{question}}\\n\\nRespuesta:\",\n        \"target_template\": \"{{answer}}\",\n        \"preprocess\": {\n          \"type\": \"python\",\n          \"source\": \"def transform(row):\\n    return row\\n\"\n        },\n        \"grader\": {\n          \"type\": \"python\",\n          \"contract\": \"model_backed\",\n          \"model_access\": \"mka1\",\n          \"file_id\": \"file_grader123\",\n          \"timeout_seconds\": 120\n        }\n      }\n    ]\n  },\n  \"make_active\": true\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "object": "<unknown>",
  "suite_id": "<string>",
  "version": 0,
  "manifest": {
    "tasks": [
      "<unknown>"
    ],
    "schema_version": "2026-05-27",
    "metadata": {}
  },
  "dataset_file_ids": [
    "<string>"
  ],
  "metadata": {},
  "created_at": 0
}

Authorizations

Authorization
string
header
required

Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.

Headers

X-On-Behalf-Of
string

Optional external end-user identifier forwarded by the API gateway.

Path Parameters

suite_id
string
required

Body

application/json
manifest
object
required
metadata
object
make_active
boolean
default:true

Response

200 - application/json

OK

id
string
required
object
any
required
suite_id
string
required
version
integer
required
Required range: -9007199254740991 <= x <= 9007199254740991
manifest
object
required
dataset_file_ids
string[]
required
metadata
object
required
created_at
integer
required
Required range: -9007199254740991 <= x <= 9007199254740991