Skip to main content
The MKA1 API can return text, audio, and images. Text is the default output modality. Use modalities and audio to enable speech output, or add the image_generation tool to produce images.

Supported output types

ModalityHow to enableOutput format
TextDefault — no extra configoutput_text in response
Audio (speech)Set modalities: ["text", "audio"]Base64 audio + transcript
ImageAdd image_generation toolImage URL or base64

Generate audio (text-to-speech)

Request audio output by setting modalities to ["text", "audio"] and specifying a voice and format in the audio parameter. The response includes both the text transcript and base64-encoded audio data.

Audio configuration

ParameterOptionsDefault
voicealloy and other voice profilesalloy
formatwav, mp3, flac, opus, pcm16wav
Audio is synthesized at 24 kHz, 16-bit mono.
import { SDK } from '@meetkai/mka1';

const mka1 = new SDK({
  bearerAuth: `Bearer ${YOUR_API_KEY}`,
});

const result = await mka1.llm.responses.create({
  model: 'meetkai:functionary-swahili-large',
  input: 'Say hello in a friendly way. Keep it very short.',
  modalities: ['text', 'audio'],
  audio: { voice: 'alloy', format: 'wav' },
}, { headers: { 'X-On-Behalf-Of': '<end-user-id>' } });

// The output includes an output_audio item with base64 data and a transcript

Save audio to a file

import { writeFileSync } from 'fs';

const result = await mka1.llm.responses.create({
  model: 'meetkai:functionary-swahili-large',
  input: 'Read this sentence aloud: The quick brown fox jumps over the lazy dog.',
  modalities: ['text', 'audio'],
  audio: { voice: 'alloy', format: 'mp3' },
});

// Find the audio output in the response
const audioItem = result.output.find((item) => item.type === 'output_audio');
if (audioItem) {
  const audioBuffer = Buffer.from(audioItem.data, 'base64');
  writeFileSync('output.mp3', audioBuffer);
}

Supported languages

Audio output supports automatic language detection and 20+ languages including English, Chinese, Hindi, Spanish, Arabic, Bengali, Portuguese, Russian, Japanese, Punjabi, German, Korean, French, Turkish, Italian, Thai, Polish, Dutch, Indonesian, Vietnamese, and Urdu.

Generate images

Use the image_generation tool to create images from text prompts. The model interprets your message, generates a prompt for the image model, and returns the result.

Image generation models

ModelBest for
meetkai:flux-2-kleinFast generation, general purpose (default)
meetkai:z-image-turboHigh-quality, detailed images

Image generation options

ParameterOptionsDefault
size1024x1024, 1024x1536, 1536x1024, autoauto
qualitylow, medium, high, autoauto
output_formatpng, webp, jpegpng
backgroundtransparent, opaque, autoauto
import { SDK } from '@meetkai/mka1';

const mka1 = new SDK({
  bearerAuth: `Bearer ${YOUR_API_KEY}`,
});

const result = await mka1.llm.responses.create({
  model: 'meetkai:functionary-swahili-large',
  input: 'Generate an image of a sunset over a mountain lake.',
  tools: [
    {
      type: 'image_generation',
      model: 'meetkai:flux-2-klein',
      quality: 'high',
      size: '1024x1024',
      output_format: 'png',
    },
  ],
}, { headers: { 'X-On-Behalf-Of': '<end-user-id>' } });

// The output includes an image_generation_call item with a result URL
const imageCall = result.output.find((item) => item.type === 'image_generation_call');
console.log('Image URL:', imageCall?.result);

Force image generation

Use tool_choice to ensure the model generates an image rather than responding with text only.
const result = await mka1.llm.responses.create({
  model: 'meetkai:functionary-swahili-large',
  input: 'A red circle on a white background.',
  tools: [{ type: 'image_generation' }],
  toolChoice: { type: 'image_generation' },
});

Image output structure

The response output array contains these items when an image is generated:
  1. function_call — the model’s call to the image generation tool with the refined prompt
  2. image_generation_call — the generation result with status: "completed" and result (image URL)
  3. function_call_output — the raw tool output containing the URL
  4. message — the model’s text response describing or referencing the image
Image URLs expire after 1 hour. Download or cache them if you need long-term access.

Standalone APIs

For direct access without going through the Responses API, MKA1 also provides standalone endpoints:

Text-to-speech API

const ttsResult = await mka1.llm.speech.tts({
  text: 'Hello, welcome to the MKA1 platform.',
  language: 'en',
});

Images API

const imageResult = await mka1.llm.images.generate({
  model: 'meetkai:z-image-turbo',
  prompt: 'A futuristic city skyline at dusk',
  size: '1024x1024',
  quality: 'hd',
});

Next steps