### Install SDK and Make First Call Source: https://zyloo.io/docs Install the official SDK, set your Zyloo API key as an environment variable, and make a sample API call using curl. ```bash # 1. Install the official SDK (any language) npm install openai # 2. Get your key from https://zyloo.io/dashboard export ZYLOO_KEY=sk-zy-... # 3. Make your first call curl https://api.zyloo.io/v1/chat/completions \ -H "Authorization: Bearer $ZYLOO_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "zyloo/claude-opus-4-7", "messages": [{"role": "user", "content": "Hello"}] }' ``` -------------------------------- ### List Available Models Source: https://zyloo.io/docs Fetch a list of all available models by making a GET request to the /v1/models endpoint. ```bash curl https://api.zyloo.io/v1/models \ -H "Authorization: Bearer $ZYLOO_KEY" ``` -------------------------------- ### Configure Agentic CLIs and Editors Source: https://zyloo.io/docs Set environment variables for agentic CLIs like Claude Code or opencode to use Zyloo's base URL. For OpenAI-compatible editors like Cursor, configure the base URL and API key. ```bash # Claude Code, opencode, and other agentic CLIs export ANTHROPIC_BASE_URL=https://api.zyloo.io export ANTHROPIC_API_KEY=$ZYLOO_KEY # Cursor and other OpenAI-compatible editors # Base URL: https://api.zyloo.io/v1 # API key: $ZYLOO_KEY ``` -------------------------------- ### Chat Completions with OpenAI SDK Source: https://zyloo.io/docs Use the OpenAI SDK to create chat completions with Zyloo models. Configure the API key and base URL for Zyloo. ```typescript import OpenAI from "openai"; const zyloo = new OpenAI({ apiKey: process.env.ZYLOO_KEY, baseURL: "https://api.zyloo.io/v1", }); const res = await zyloo.chat.completions.create({ model: "zyloo/gemini-3.5-flash", messages: [ { role: "system", content: "You are concise." }, { role: "user", content: "Summarize this PR..." }, ], temperature: 0.2, max_tokens: 512, }); console.log(res.choices[0].message.content); ``` -------------------------------- ### List Models Source: https://zyloo.io/docs Retrieves a list of available models that can be used for API requests. ```APIDOC ## GET /v1/models ### Description Fetches a list of all available models, including their IDs and capabilities. ### Method GET ### Endpoint /v1/models ### Response #### Success Response (200) - **data** (array) - A list of model objects. - **id** (string) - The canonical Zyloo ID of the model (e.g., "zyloo/claude-opus-4-7"). - **object** (string) - The type of object, usually "model". - **created** (integer) - Timestamp of model creation. - **owned_by** (string) - The entity that owns the model. ### Response Example ```json { "data": [ { "id": "zyloo/claude-opus-4-7", "object": "model", "created": 1677610602, "owned_by": "zyloo" }, { "id": "zyloo/gpt-5.5", "object": "model", "created": 1677610602, "owned_by": "zyloo" } ] } ``` ``` -------------------------------- ### Chat Completions Source: https://zyloo.io/docs This endpoint provides chat completion functionality, compatible with OpenAI's API. It supports tools, JSON mode, vision, and structured outputs on compatible models. ```APIDOC ## POST /v1/chat/completions ### Description Generates a chat completion response based on the provided messages and model. ### Method POST ### Endpoint /v1/chat/completions ### Parameters #### Request Body - **model** (string) - Required - The ID of the model to use for completion (e.g., "zyloo/claude-opus-4-7"). - **messages** (array) - Required - A list of message objects representing the conversation history. - **role** (string) - Required - The role of the author of the message (e.g., "system", "user", "assistant"). - **content** (string) - Required - The content of the message. - **temperature** (number) - Optional - Controls randomness. Lower values make the output more deterministic. - **max_tokens** (integer) - Optional - The maximum number of tokens to generate in the completion. - **stream** (boolean) - Optional - Whether to stream back partial message deltas as they are generated. ### Request Example ```json { "model": "zyloo/gemini-3.5-flash", "messages": [ {"role": "system", "content": "You are concise."} , {"role": "user", "content": "Summarize this PR..."} ], "temperature": 0.2, "max_tokens": 512 } ``` ### Response #### Success Response (200) - **choices** (array) - A list of completion choices. - **message** (object) - The generated message. - **role** (string) - The role of the assistant. - **content** (string) - The content of the assistant's message. #### Response Example ```json { "choices": [ { "message": { "role": "assistant", "content": "This PR introduces feature X." } } ] } ``` ``` -------------------------------- ### Streaming Chat Completions Source: https://zyloo.io/docs Enable streaming for chat completions by setting `stream: true`. Process the Server-Sent Events to receive content deltas. ```typescript const stream = await zyloo.chat.completions.create({ model: "zyloo/claude-opus-4-7", stream: true, messages: [{ role: "user", content: "Tell me a story" }], }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` -------------------------------- ### API Authentication Header Source: https://zyloo.io/docs Include your Zyloo API key as a bearer token in the Authorization header for every request. ```http Authorization: Bearer sk-zy-9f3a0e5b... ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.