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.
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:
curl https://api.masidyn.dev/health curl -H "Authorization: Bearer $MASIDYN_TOKEN" https://api.masidyn.dev/v1/models
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).
- 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.
- Start the authorization-code flow with a fresh
state, a PKCE verifier, itsS256challenge, the registeredclient_idandredirect_uri, andresource=https://api.masidyn.dev/v1. Request the scopes your application registered, includingopenid profile masidyn.workspace.readfor the cloud examples. - Verify
stateat the callback, then exchange the authorizationcodeat/oauth/tokenusing the sameclient_id,redirect_uri,resource, and the originalcode_verifier. The grant type isauthorization_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.
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.
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.
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.
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!"}]
}'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)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); 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.
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.