MULTI-TENANT CLOUD QUICKSTART

Quickstart.

Call MasiDyn Cloud 24/7 over HTTPS at https://api.masidyn.dev/v1 with OAuth 2.0 / OIDC (https://account.masidyn.dev) or connect Copilot Studio directly via Remote MCP (https://api.masidyn.dev/mcp) or OpenAPI 2.0.

Three steps to call MasiDyn Cloud.

1

Check the cloud gateway and model catalog

Check public health, then the model catalog with a bearer token. These requests do not run a model:

GET /health & /v1/models
curl https://api.masidyn.dev/health
curl -H "Authorization: Bearer $MASIDYN_TOKEN" https://api.masidyn.dev/v1/models
2

Obtain an OAuth access token

Authenticate users or Copilot Studio connectors against https://account.masidyn.dev (OpenID discovery at https://account.masidyn.dev/.well-known/openid-configuration).

  1. Sign in and register your application with its exact callback URI. Choose a public client for a CLI or browser application; confidential applications keep their client secret on the server.
  2. Start the authorization-code flow with a fresh state, a PKCE verifier, its S256 challenge, the registered client_id and redirect_uri, and resource=https://api.masidyn.dev/v1. Request the scopes your application registered, including openid profile masidyn.workspace.read for the cloud examples.
  3. Verify state at the callback, then exchange the authorization code at /oauth/token using the same client_id, redirect_uri, resource, and the original code_verifier. The grant type is authorization_code.

Set MASIDYN_ACCESS_TOKEN to the returned access_token in your application environment. The SDK uses that bearer credential; signing in to the portal alone does not configure a CLI or export an API token. An id_token identifies the sign-in and is not the API access token.

OAuth 2.0 + MCP Discovery
Protected Resource: https://api.masidyn.dev/.well-known/oauth-protected-resource
MCP Endpoint:       https://api.masidyn.dev/mcp
Copilot Swagger:    https://masidyn.dev/openapi-copilot.json
Cloud API resource: https://api.masidyn.dev/v1
MCP resource:       https://api.masidyn.dev/mcp

MCP clients use the resource URL from discovery. See the Sign in with MasiDyn guide for registration and issuer endpoints.

Reconnecting an existing client? Reauthorize older grants issued without a resource indicator, or with a different resource. For REST chat and embeddings, request https://api.masidyn.dev/v1 and grant masidyn.workspace.read. Copilot's OpenAPI connector includes this resource in its authorization URL; the issuer retains it during code exchange. CLI clients send the same resource at both steps. Generic MCP uses its separate https://api.masidyn.dev/mcp resource.

3

Send Cloud Chat or Connect an Agent

Use any standard OpenAI-compatible SDK against https://api.masidyn.dev/v1 with your Bearer token, or point Copilot Studio at https://api.masidyn.dev/mcp.

POST /v1/chat/completions
curl https://api.masidyn.dev/v1/chat/completions \
  -H "Authorization: Bearer $MASIDYN_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"model":"masidyn-auto","messages":[{"role":"user","content":"Hello Cloud"}]}'

SDK SNIPPETS

curl, Python, TypeScript.

These examples use https://api.masidyn.dev/v1, MASIDYN_ACCESS_TOKEN, and masidyn-auto. Download the Python client or TypeScript client into your project first.

curlPOST /v1/chat/completions
curl https://api.masidyn.dev/v1/chat/completions \
  -H "Authorization: Bearer $MASIDYN_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "masidyn-auto",
    "messages": [{"role": "user", "content": "Hello MasiDyn!"}]
  }'
pythonmasidyn_client.py
import os
from masidyn_client import MasiDyn

# Set MASIDYN_ACCESS_TOKEN to the access_token from your OAuth code exchange.
md = MasiDyn(
    base_url="https://api.masidyn.dev/v1",
    token=os.environ["MASIDYN_ACCESS_TOKEN"],
)

reply = md.chat("masidyn-auto", "Design a resilient application.")
print(reply)

# Streaming support
for chunk in md.chat_stream("masidyn-auto", "List three design principles."):
    print(chunk, end="", flush=True)
typescriptmasidyn.ts
import { MasiDyn } from "./masidyn";

// Server-side Node.js: use the access_token from your OAuth code exchange.
const token = process.env.MASIDYN_ACCESS_TOKEN;
if (!token) throw new Error("Set MASIDYN_ACCESS_TOKEN before calling MasiDyn Cloud.");

const md = new MasiDyn({
  baseUrl: "https://api.masidyn.dev/v1",
  token,
});

const reply = await md.chat("masidyn-auto", "Explain the MasiDyn Cloud API.");
console.log(reply);
Existing client aliases remain supported. The https://masidyn.dev/v1 API alias, MASIDYN_API_KEY SDK environment alias, and Prime/Flash model IDs remain available. The current model catalog is authoritative. Manage applications at OAuth applications.

OPTIONAL LOCAL OFFLINE DESKTOP MODE

Run offline on your own machine.

Install and start the desktop runtimefor offline execution on your own CPU/GPU. Local use requires no cloud account or access token. The Python and Node.js clients can read the runtime's Port-0 handshake files, or you can explicitly select the loopback URL reported by your runtime. The example below uses the common http://127.0.0.1:11435 address; replace it with the discovered address when it differs.

Optional local offline desktop server
from masidyn_client import MasiDyn

local = MasiDyn(base_url="http://127.0.0.1:11435", token="")
print(local.health())
print(local.models())

Where to go next.

  • API Reference — Cloud API routes, Remote MCP, Copilot Studio Swagger 2.0, and SSE streaming.
  • Model Family — Cloud Gemini models and optional local offline rungs.
  • Download — Desktop app, CLI, and zero-dependency client libraries.