MelonsRun
Sdks

SDK Overview

Official TypeScript and Python clients for the MelonsRun platform

LanguagePackageClient class
TypeScript/JavaScript@melons/sdkMelons
Pythonmelons-sdkClient

Both SDKs expose one client that covers both halves of the platform:

  • OpenAI-compatible LLM/v1/chat/completions, /v1/completions, /v1/embeddings, /v1/responses, /v1/models. Drop-in for the OpenAI SDK by pointing baseURL/base_url at https://api.melons.run/v1.
  • Unified async media tasks/v2/task/*, with tasks.run(...) that submits a task and polls until a terminal state.
  • Quote & catalog/v2/quote and /v2/models.

Design

openapi.json is the single source of truth. Each SDK is built in two layers:

  1. Generated typed layer — produced directly from openapi.json; never edited by hand.
  2. Hand-written ergonomic wrapper — a thin Melons/Client class with chat.completions.create (with streaming), tasks.create / tasks.get / tasks.run, quote, models.list, and typed errors mapped from the platform's ErrorEnvelope.

30-second quickstart

import { Melons } from "@melons/sdk";
const client = new Melons({ apiKey: process.env.MELONS_API_KEY });
const task = await client.tasks.run({ model: "m", input: { prompt: "a cat" } });

On this page