SDK Guide

Use the AIMS SDK to integrate AI skills, relay access, and on-chain attestation into your application. The SDK wraps the AIMS REST API with typed clients for TypeScript and Python.

1. Get an API Key

Before you can call the relay or other authenticated endpoints, you need an API key. Go to the API Station, connect your wallet, and click "Generate Key". Copy the key — it will only be shown once.

Keys have the format aims_sk_<48 hex chars>. Use Basic tier for development (1,000 calls/day), Pro for production (10,000 calls/day).

2. Install

npm install @aims-v2/sdk
# or
pip install aims-v2-sdk

The SDK is also available as a standalone ES module for direct use in edge functions and browser extensions.

3. Configure

import { AimsClient } from "@aims-v2/sdk";

const aims = new AimsClient({
  apiKey: process.env.AIMS_API_KEY,     // aims_sk_...
  baseUrl:  "https://api.aimsgateway.com",
});

4. Chat Completions (Relay)

The relay endpoint is OpenAI-compatible — you can point any OpenAI SDK at AIMS by changing the base URL and API key.

const res = await aims.relay.chat.create({
  model: "deepseek-chat",
  messages: [{ role: "user", content: "Hello from AIMS!" }],
  max_tokens: 500,
  temperature: 0.7,
});

console.log(res.choices[0].message.content);

5. Marketplace

// List available skills
const skills = await aims.marketplace.list({ search: "coding", page: 1 });

// Get a single skill
const skill = await aims.marketplace.get("skill_uuid");

6. IP Vault

Register your skill for on-chain copyright attestation. Requires a developer wallet authenticated via Web3 signature.

// Register IP with on-chain attestation
const result = await aims.ipVault.register({
  skill_name: "my-fine-tuned-model",
  version: "1.0.0",
});

// Verify an existing registration
const cert = await aims.ipVault.verify("cert_uuid");

Raw REST

You can also call the API directly without the SDK — just include your API key or JWT in the Authorization header. See the API Reference for all endpoints.