SDKs at tools

Bumuo gamit ang Arteza mula sa TypeScript, Python o ang iyong terminal

Official na clients para sa TypeScript at Python, isang command line para sa iyong terminal at scripts, at skills na nagtuturo sa coding agents kung paano bumuo ng media nang tama. Bawat isa ay maliit, walang dependencies, at direktang inihahain mula sa arteza.ai.

I-install lahat sa isang linya

Ini-install ang arteza command at ang Claude Code skill. I-set ang ARTEZA_PYTHON=1 upang idagdag ang Python SDK.

curl -fsSL https://arteza.ai/sdk/install.sh | sh
arteza login

Kailangan mo ng API key. Lumikha ng isa sa console, pagkatapos tumakbo ng arteza login o i-set ang ARTEZA_API_KEY. Buksan ang console

TypeScript at JavaScript

Typed client para sa Node 18+, Bun, Deno at edge runtimes. ESM at CommonJS, may type declarations.

npm install https://arteza.ai/sdk/arteza.tgz
import { Arteza } from "arteza";

const arteza = new Arteza(); // reads ARTEZA_API_KEY

const gen = await arteza.run("seedance-2", {
  prompt: "a koi pond at dawn, slow dolly in",
  duration: 5,
});
console.log(gen.output?.files[0].url, gen.billing);

Python

Standard library lamang, Python 3.8 at mas bago. Kasama ang parehong command line tulad ng python -m arteza.

pip install https://arteza.ai/sdk/arteza-0.5.0-py3-none-any.whl
from arteza import Arteza

arteza = Arteza()  # reads ARTEZA_API_KEY
gen = arteza.run("seedance-2", {"prompt": "a koi pond at dawn", "duration": 5})
print(gen["output"]["files"][0]["url"], gen["billing"])

est = arteza.estimate("seedance-2", {"prompt": "...", "duration": 5})
print(est["price"]["credits"]["amount"], est["affordable"])

Swift, Kotlin, Dart at Go

Native SDK para sa mga telepono, desktop at mga server. Bawat isa ay isang file na walang dependencies, inilaan mula sa arteza.ai na may versioned package sa tabi nito, at gumagawa kung ano ang ginagawa ng TypeScript at Python SDK: mga pagsubok gamit ang Idempotency-Key, naghihintay ng mga resulta, live status, mga pag-upload, client token at na-type na mga error. Sa isang app, mag-sign ng mga request gamit ang isang client token mula sa iyong sariling server, hindi kailanman ang API key.

Swift

Para sa iOS, iPadOS, macOS, tvOS at watchOS app, na may async/await. Idagdag ang file sa iyong target, o idagdag ang package nang lokal sa Xcode.

# Drop the one file into your Xcode target:
curl -fsSL https://arteza.ai/sdk/swift/Arteza.swift -o Arteza.swift
# or unzip the package and add it with File > Add Package Dependencies > Add Local:
curl -fsSLO https://arteza.ai/sdk/arteza-swift-0.5.0.zip
import Arteza

// In an app, use a short-lived client token from YOUR server (POST /v1/tokens), never the API key.
let arteza = try Arteza(apiKey: clientToken)
let gen = try await arteza.run("nano-banana-2", ["prompt": "a koi pond at dawn"])
print(gen.files.first?.url ?? "")

// Every job on the account, live, on one connection:
for try await update in arteza.generations.events() {
    print(update.id, update.status)
}

Kotlin

Para sa Android at anumang JVM project. Gumagamit ito ng sariling HTTP client ng platform at isang built-in na JSON codec, kaya hindi ito nagdadagdag sa iyong dependencies. Ang mga tawag ay pumipigil, kaya patakbuhin ang mga ito sa labas ng pangunahing thread.

# Drop the one file into your module (package ai.arteza):
curl -fsSL https://arteza.ai/sdk/kotlin/Arteza.kt -o app/src/main/kotlin/ai/arteza/Arteza.kt
import ai.arteza.Arteza

// In an app, use a short-lived client token from YOUR server (POST /v1/tokens), never the API key.
val arteza = Arteza(apiKey = clientToken)
val gen = withContext(Dispatchers.IO) {
    arteza.run("nano-banana-2", mapOf("prompt" to "a koi pond at dawn"))
}
println(gen.files.first().url)

Dart / Flutter

Para sa Flutter app sa iOS, Android at desktop, at para sa Dart sa server. Ang live status ay dumadating bilang isang Dart Stream.

# Drop the one file into lib/:
curl -fsSL https://arteza.ai/sdk/dart/arteza.dart -o lib/arteza.dart
# or unzip the package next to your app and add  arteza: { path: ../arteza }
curl -fsSLO https://arteza.ai/sdk/arteza-dart-0.5.0.zip
import 'package:arteza/arteza.dart';

// In an app, use a short-lived client token from YOUR server (POST /v1/tokens), never the API key.
final arteza = Arteza(apiKey: clientToken);
final gen = await arteza.run('nano-banana-2', {'prompt': 'a koi pond at dawn'});
print(gen.files.first.url);

await for (final update in arteza.generations.events()) {
  print('${update.id} ${update.status}');
}

Go

Para sa Go na mga serbisyo. Nag-install ito gamit ang go get direkta mula sa arteza.ai at gumagamit lamang ng standard library, na may webhook verification at client token para sa iyong mga app.

go get arteza.ai/sdk/go@v0.5.0
import arteza "arteza.ai/sdk/go"

c, _ := arteza.New(arteza.Options{}) // reads ARTEZA_API_KEY
gen, err := c.Run(ctx, "seedance-2", arteza.JSON{"prompt": "a koi pond at dawn", "duration": 5})
if err != nil { log.Fatal(err) }
fmt.Println(gen.Files()[0].URL)

// Mint a client token for a phone app:
tok, _ := c.CreateToken(ctx, arteza.TokenParams{TTLSeconds: 900, User: userID})

Command line

Bumuo, presyohan, mag-upload at pamahalaan ang history mula sa terminal o script. Ang mga lokal na file ay ina-upload para sa iyo, ang mga output ay dini-download, at --json ay ginagawang machine-readable ang bawat command.

arteza models --category video
arteza model kling-3-pro
arteza run seedance-2 -p "a koi pond at dawn" duration=5 -o ./out
arteza run rmbg-birefnet image_url=@./photo.png
arteza run auto -p "a logo for a coffee shop" --task text-to-image --priority cost
arteza estimate veo-3 -p "a storm over the sea" duration=8
arteza list --json

Skills para sa coding agents

Turuan ang Claude Code, Cursor at Codex kung paano pumili ng model, presyohan ang isang generation bago gumastos, patakbuhin ito at harapin ang mga error. Ang skill ay tumuturo sa mga agents sa live catalogue sa halip na hulaan ang model ids.

mkdir -p ~/.claude/skills/arteza
curl -fsSL https://arteza.ai/sdk/skills/arteza/SKILL.md -o ~/.claude/skills/arteza/SKILL.md

Gumagana ka sa Claude, ChatGPT o Cursor chat sa halip na code? I-connect ang MCP server at magtanong sa plain words. I-connect ang MCP server

Ang ginagawa ng SDKs para sa iyo

  • Retries sa rate limits, timeouts at server errors, na may backoff na sumusunod sa Retry-After.
  • Isang idempotency key sa bawat generation, kaya isang retried request ay hindi kailanman kinokobro ng dalawang beses.
  • ang run() ay nagsisimula ng isang generation at naghihintay para dito, na nag-uulat ng bawat pagbabago ng status.
  • Uploads mula sa bytes o file path, na nagbabalik ng URL na tinatanggap ng anumang model input.
  • Typed errors na nagdadala ng status, error code, parameter at request id.
  • Webhook signature verification sa isang call, na may replay window.
  • Iterators na nag-page through ng iyong buong history.
  • Isang live na koneksyon para sa bawat trabaho sa account, GET /v1/events, na muling nagsisimula kung saan ito tumigil pagkatapos ng pagbagsak.

Mga Download

FileBersyonLaki
arteza-0.5.0.tgz0.5.029.8 KB
arteza-0.5.0-py3-none-any.whl0.5.014.2 KB
arteza-swift-0.5.0.zip0.5.08.1 KB
swift/Arteza.swift0.5.020.9 KB
arteza-kotlin-0.5.0.zip0.5.08.3 KB
kotlin/Arteza.kt0.5.020.9 KB
arteza-dart-0.5.0.zip0.5.07.1 KB
dart/arteza.dart0.5.015.8 KB
go/arteza.go0.5.018.6 KB
skills/arteza/SKILL.md0.5.05.6 KB
skills/arteza.mdc0.5.05.7 KB
skills/AGENTS.md0.5.05.4 KB
install.sh0.5.01.1 KB

Ang mga file ay nabuo nang reproducible mula sa source sa Arteza repository, kaya ang mga checksums na ito ay nagbabago lamang kapag nagbago ang code. Ang buong listahan ay nasa manifest.json. manifest.json

Para sa agents at tools