[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-openrouter-openrouter-typescript-sdk":3,"mdc--stw633-key":33,"related-org-openrouter-openrouter-typescript-sdk":20131,"related-repo-openrouter-openrouter-typescript-sdk":20270},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":29,"sourceUrl":31,"mdContent":32},"openrouter-typescript-sdk","integrate OpenRouter TypeScript SDK","Complete reference for integrating with 300+ AI models through the OpenRouter TypeScript SDK and Agent packages using the callModel pattern",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"openrouter","OpenRouter","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fopenrouter.png","OpenRouterTeam",[13,17,20],{"name":14,"slug":15,"type":16},"LLM","llm","tag",{"name":18,"slug":19,"type":16},"TypeScript","typescript",{"name":21,"slug":22,"type":16},"SDK","sdk",187,"https:\u002F\u002Fgithub.com\u002FOpenRouterTeam\u002Fskills","2026-07-14T05:38:31.475029",null,26,[],{"repoUrl":24,"stars":23,"forks":27,"topics":30,"description":26},[],"https:\u002F\u002Fgithub.com\u002FOpenRouterTeam\u002Fskills\u002Ftree\u002FHEAD\u002Fskills\u002Fopenrouter-typescript-sdk","---\nname: openrouter-typescript-sdk\ndescription: Complete reference for integrating with 300+ AI models through the OpenRouter TypeScript SDK and Agent packages using the callModel pattern\nversion: 2.0.0\n---\n\n# OpenRouter TypeScript SDK\n\nA comprehensive TypeScript SDK for interacting with OpenRouter's unified API, providing access to 300+ AI models through a single, type-safe interface. This skill enables AI agents to leverage the `callModel` pattern for text generation, tool usage, streaming, and multi-turn conversations.\n\nThe SDK is split into two packages:\n- **`@openrouter\u002Fagent`** — Agent features: `callModel`, `tool()`, stop conditions, streaming, format converters\n- **`@openrouter\u002Fsdk`** — Platform features: model listing, chat completions, credits, OAuth, API key management\n\n---\n\n## Installation\n\n```bash\n# For agent features (callModel, tools, stop conditions)\nnpm install @openrouter\u002Fagent\n\n# For platform features (models, credits, OAuth, API keys)\nnpm install @openrouter\u002Fsdk\n```\n\n## Setup\n\nGet your API key from [openrouter.ai\u002Fsettings\u002Fkeys](https:\u002F\u002Fopenrouter.ai\u002Fsettings\u002Fkeys), then initialize:\n\n```typescript\nimport { OpenRouter } from '@openrouter\u002Fagent';\n\nconst client = new OpenRouter({\n  apiKey: process.env.OPENROUTER_API_KEY\n});\n```\n\n---\n\n## Authentication\n\nThe SDK supports two authentication methods: API keys for server-side applications and OAuth PKCE flow for user-facing applications.\n\n### API Key Authentication\n\nThe primary authentication method uses API keys from your OpenRouter account.\n\n#### Obtaining an API Key\n\n1. Visit [openrouter.ai\u002Fsettings\u002Fkeys](https:\u002F\u002Fopenrouter.ai\u002Fsettings\u002Fkeys)\n2. Create a new API key\n3. Store securely in an environment variable\n\n#### Environment Setup\n\n```bash\nexport OPENROUTER_API_KEY=sk-or-v1-your-key-here\n```\n\n#### Client Initialization\n\n```typescript\nimport { OpenRouter } from '@openrouter\u002Fagent';\n\nconst client = new OpenRouter({\n  apiKey: process.env.OPENROUTER_API_KEY\n});\n```\n\nThe client automatically uses this key for all subsequent requests:\n\n```typescript\n\u002F\u002F API key is automatically included\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Hello!'\n});\n```\n\n#### Get Current Key Metadata\n\nRetrieve information about the currently configured API key (requires `@openrouter\u002Fsdk`):\n\n```typescript\nimport OpenRouter from '@openrouter\u002Fsdk';\nconst sdkClient = new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY });\n\nconst keyInfo = await sdkClient.apiKeys.getCurrentKeyMetadata();\nconsole.log('Key name:', keyInfo.name);\nconsole.log('Created:', keyInfo.createdAt);\n```\n\n#### API Key Management\n\nProgrammatically manage API keys:\n\n```typescript\n\u002F\u002F List all keys\nconst keys = await client.apiKeys.list();\n\n\u002F\u002F Create a new key\nconst newKey = await client.apiKeys.create({\n  name: 'Production API Key'\n});\n\n\u002F\u002F Get a specific key by hash\nconst key = await client.apiKeys.get({\n  hash: 'sk-or-v1-...'\n});\n\n\u002F\u002F Update a key\nawait client.apiKeys.update({\n  hash: 'sk-or-v1-...',\n  requestBody: {\n    name: 'Updated Key Name'\n  }\n});\n\n\u002F\u002F Delete a key\nawait client.apiKeys.delete({\n  hash: 'sk-or-v1-...'\n});\n```\n\n### OAuth Authentication (PKCE Flow)\n\nFor user-facing applications where users should control their own API keys, OpenRouter supports OAuth with PKCE (Proof Key for Code Exchange). This flow allows users to generate API keys through a browser authorization flow without your application handling their credentials.\n\n#### createAuthCode\n\nGenerate an authorization code and URL to start the OAuth flow:\n\n```typescript\nconst authResponse = await client.oAuth.createAuthCode({\n  callbackUrl: 'https:\u002F\u002Fmyapp.com\u002Fauth\u002Fcallback'\n});\n\n\u002F\u002F authResponse contains:\n\u002F\u002F - authorizationUrl: URL to redirect the user to\n\u002F\u002F - code: The authorization code for later exchange\n\nconsole.log('Redirect user to:', authResponse.authorizationUrl);\n```\n\n**Parameters:**\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `callbackUrl` | `string` | Yes | Your application's callback URL after user authorization |\n\n**Browser Redirect:**\n\n```typescript\n\u002F\u002F In a browser environment\nwindow.location.href = authResponse.authorizationUrl;\n\n\u002F\u002F Or in a server-rendered app, return a redirect response\nres.redirect(authResponse.authorizationUrl);\n```\n\n#### exchangeAuthCodeForAPIKey\n\nAfter the user authorizes your application, they are redirected back to your callback URL with an authorization code. Exchange this code for an API key:\n\n```typescript\n\u002F\u002F In your callback handler\nconst code = req.query.code;  \u002F\u002F From the redirect URL\n\nconst apiKeyResponse = await client.oAuth.exchangeAuthCodeForAPIKey({\n  code: code\n});\n\n\u002F\u002F apiKeyResponse contains:\n\u002F\u002F - key: The user's API key\n\u002F\u002F - Additional metadata about the key\n\nconst userApiKey = apiKeyResponse.key;\n\n\u002F\u002F Store securely for this user's future requests\nawait saveUserApiKey(userId, userApiKey);\n```\n\n**Parameters:**\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `code` | `string` | Yes | The authorization code from the OAuth redirect |\n\n#### Complete OAuth Flow Example\n\n```typescript\nimport OpenRouter from '@openrouter\u002Fsdk';\nimport { OpenRouter as Agent } from '@openrouter\u002Fagent';\nimport express from 'express';\n\nconst app = express();\n\u002F\u002F SDK client for OAuth and API key management\nconst client = new OpenRouter({\n  apiKey: process.env.OPENROUTER_API_KEY\n});\n\n\u002F\u002F Step 1: Initiate OAuth flow\napp.get('\u002Fauth\u002Fstart', async (req, res) => {\n  const authResponse = await client.oAuth.createAuthCode({\n    callbackUrl: 'https:\u002F\u002Fmyapp.com\u002Fauth\u002Fcallback'\n  });\n\n  \u002F\u002F Store any state needed for the callback\n  req.session.oauthState = { \u002F* ... *\u002F };\n\n  \u002F\u002F Redirect user to OpenRouter authorization page\n  res.redirect(authResponse.authorizationUrl);\n});\n\n\u002F\u002F Step 2: Handle callback and exchange code\napp.get('\u002Fauth\u002Fcallback', async (req, res) => {\n  const { code } = req.query;\n\n  if (!code) {\n    return res.status(400).send('Authorization code missing');\n  }\n\n  try {\n    const apiKeyResponse = await client.oAuth.exchangeAuthCodeForAPIKey({\n      code: code as string\n    });\n\n    \u002F\u002F Store the user's API key securely\n    await saveUserApiKey(req.session.userId, apiKeyResponse.key);\n\n    res.redirect('\u002Fdashboard?auth=success');\n  } catch (error) {\n    console.error('OAuth exchange failed:', error);\n    res.redirect('\u002Fauth\u002Ferror');\n  }\n});\n\n\u002F\u002F Step 3: Use the user's API key for their requests\napp.post('\u002Fapi\u002Fchat', async (req, res) => {\n  const userApiKey = await getUserApiKey(req.session.userId);\n\n  \u002F\u002F Create an agent client with the user's key\n  const userAgent = new Agent({\n    apiKey: userApiKey\n  });\n\n  const result = userAgent.callModel({\n    model: 'openai\u002Fgpt-5-nano',\n    input: req.body.message\n  });\n\n  const text = await result.getText();\n  res.json({ response: text });\n});\n```\n\n### Security Best Practices\n\n1. **Environment Variables**: Store API keys in environment variables, never in code\n2. **Key Rotation**: Rotate keys periodically using the key management API\n3. **Environment Separation**: Use different keys for development, staging, and production\n4. **OAuth for Users**: Use the OAuth PKCE flow for user-facing apps to avoid handling user credentials\n5. **Secure Storage**: Store user API keys encrypted in your database\n6. **Minimal Scope**: Create keys with only the permissions needed\n\n---\n\n## Core Concepts: callModel\n\nThe `callModel` function is the primary interface for text generation. It provides a unified, type-safe way to interact with any supported model.\n\n### Basic Usage\n\n```typescript\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Explain quantum computing in one sentence.',\n});\n\nconst text = await result.getText();\n```\n\n### Key Benefits\n\n- **Type-safe parameters** with full IDE autocomplete\n- **Auto-generated from OpenAPI specs** - automatically updates with new models\n- **Multiple consumption patterns** - text, streaming, structured data\n- **Automatic tool execution** with multi-turn support\n\n---\n\n## Input Formats\n\nThe SDK accepts flexible input types for the `input` parameter:\n\n### String Input\nA simple string becomes a user message:\n\n```typescript\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Hello, how are you?'\n});\n```\n\n### Message Arrays\nFor multi-turn conversations:\n\n```typescript\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: [\n    { role: 'user', content: 'What is the capital of France?' },\n    { role: 'assistant', content: 'The capital of France is Paris.' },\n    { role: 'user', content: 'What is its population?' }\n  ]\n});\n```\n\n### Multimodal Content\nIncluding images and text:\n\n```typescript\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: [\n    {\n      role: 'user',\n      content: [\n        { type: 'text', text: 'What is in this image?' },\n        { type: 'image_url', image_url: { url: 'https:\u002F\u002Fexample.com\u002Fimage.png' } }\n      ]\n    }\n  ]\n});\n```\n\n### System Instructions\nUse the `instructions` parameter for system-level guidance:\n\n```typescript\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  instructions: 'You are a helpful coding assistant. Be concise.',\n  input: 'How do I reverse a string in Python?'\n});\n```\n\n---\n\n## Response Methods\n\nThe result object provides multiple methods for consuming the response:\n\n| Method | Purpose |\n|--------|---------|\n| `getText()` | Get complete text after all tools complete |\n| `getResponse()` | Full response object with token usage |\n| `getTextStream()` | Stream text deltas as they arrive |\n| `getReasoningStream()` | Stream reasoning tokens (for o1\u002Freasoning models) |\n| `getToolCallsStream()` | Stream tool calls as they complete |\n\n### getText()\n\n```typescript\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Write a haiku about coding'\n});\n\nconst text = await result.getText();\nconsole.log(text);\n```\n\n### getResponse()\n\n```typescript\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Hello!'\n});\n\nconst response = await result.getResponse();\nconsole.log('Text:', response.text);\nconsole.log('Token usage:', response.usage);\n```\n\n### getTextStream()\n\n```typescript\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Write a short story'\n});\n\nfor await (const delta of result.getTextStream()) {\n  process.stdout.write(delta);\n}\n```\n\n---\n\n## Tool System\n\nCreate strongly-typed tools using Zod schemas for automatic validation and type inference.\n\n### Defining Tools\n\n```typescript\nimport { tool } from '@openrouter\u002Fagent\u002Ftool';\nimport { z } from 'zod';\n\nconst weatherTool = tool({\n  name: 'get_weather',\n  description: 'Get current weather for a location',\n  inputSchema: z.object({\n    location: z.string().describe('City name'),\n    units: z.enum(['celsius', 'fahrenheit']).optional().default('celsius')\n  }),\n  outputSchema: z.object({\n    temperature: z.number(),\n    conditions: z.string(),\n    humidity: z.number()\n  }),\n  execute: async (params) => {\n    \u002F\u002F Implement weather fetching logic\n    return {\n      temperature: 22,\n      conditions: 'Sunny',\n      humidity: 45\n    };\n  }\n});\n```\n\n### Using Tools with callModel\n\n```typescript\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'What is the weather in Paris?',\n  tools: [weatherTool]\n});\n\nconst text = await result.getText();\n\u002F\u002F The SDK automatically executes the tool and continues the conversation\n```\n\n### Tool Types\n\n#### Regular Tools\nStandard execute functions that return a result:\n\n```typescript\nconst calculatorTool = tool({\n  name: 'calculate',\n  description: 'Perform mathematical calculations',\n  inputSchema: z.object({\n    expression: z.string()\n  }),\n  execute: async ({ expression }) => {\n    return { result: eval(expression) };\n  }\n});\n```\n\n#### Generator Tools\nYield progress events using `eventSchema`:\n\n```typescript\nconst searchTool = tool({\n  name: 'web_search',\n  description: 'Search the web',\n  inputSchema: z.object({ query: z.string() }),\n  eventSchema: z.object({\n    type: z.literal('progress'),\n    message: z.string()\n  }),\n  outputSchema: z.object({ results: z.array(z.string()) }),\n  execute: async function* ({ query }) {\n    yield { type: 'progress', message: 'Searching...' };\n    yield { type: 'progress', message: 'Processing results...' };\n    return { results: ['Result 1', 'Result 2'] };\n  }\n});\n```\n\n#### Manual Tools\nSet `execute: false` to handle tool calls yourself:\n\n```typescript\nconst manualTool = tool({\n  name: 'user_confirmation',\n  description: 'Request user confirmation',\n  inputSchema: z.object({ message: z.string() }),\n  execute: false\n});\n```\n\n---\n\n## Multi-Turn Conversations with Stop Conditions\n\nControl automatic tool execution with stop conditions:\n\n```typescript\nimport { stepCountIs, maxCost, hasToolCall } from '@openrouter\u002Fagent\u002Fstop-conditions';\n\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5.2',\n  input: 'Research this topic thoroughly',\n  tools: [searchTool, analyzeTool],\n  stopWhen: [\n    stepCountIs(10),      \u002F\u002F Stop after 10 turns\n    maxCost(1.00),        \u002F\u002F Stop if cost exceeds $1.00\n    hasToolCall('finish') \u002F\u002F Stop when 'finish' tool is called\n  ]\n});\n```\n\n### Available Stop Conditions\n\n| Condition | Description |\n|-----------|-------------|\n| `stepCountIs(n)` | Stop after n turns |\n| `maxCost(amount)` | Stop when cost exceeds amount |\n| `hasToolCall(name)` | Stop when specific tool is called |\n\n### Custom Stop Conditions\n\n```typescript\nconst customStop = (context) => {\n  return context.messages.length > 20;\n};\n\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Complex task',\n  tools: [myTool],\n  stopWhen: customStop\n});\n```\n\n---\n\n## Dynamic Parameters\n\nCompute parameters based on conversation context:\n\n```typescript\nconst result = client.callModel({\n  model: (ctx) => ctx.numberOfTurns > 3 ? 'openai\u002Fgpt-4' : 'openai\u002Fgpt-4o-mini',\n  temperature: (ctx) => ctx.numberOfTurns > 1 ? 0.3 : 0.7,\n  input: 'Hello!'\n});\n```\n\n### Context Object Properties\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `numberOfTurns` | number | Current turn count |\n| `messages` | array | All messages so far |\n| `instructions` | string | Current system instructions |\n| `totalCost` | number | Accumulated cost |\n\n---\n\n## nextTurnParams: Context Injection\n\nTools can modify parameters for subsequent turns, enabling skills and context-aware behavior:\n\n```typescript\nconst skillTool = tool({\n  name: 'load_skill',\n  description: 'Load a specialized skill',\n  inputSchema: z.object({\n    skill: z.string().describe('Name of the skill to load')\n  }),\n  nextTurnParams: {\n    instructions: (params, context) => {\n      const skillInstructions = loadSkillInstructions(params.skill);\n      return `${context.instructions}\\n\\n${skillInstructions}`;\n    }\n  },\n  execute: async ({ skill }) => {\n    return { loaded: skill };\n  }\n});\n```\n\n### Use Cases for nextTurnParams\n\n- **Skill Systems**: Dynamically load specialized capabilities\n- **Context Accumulation**: Build up context over multiple turns\n- **Mode Switching**: Change model behavior mid-conversation\n- **Memory Injection**: Add retrieved context to instructions\n\n---\n\n## Generation Parameters\n\nControl model behavior with these parameters:\n\n```typescript\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Write a creative story',\n  temperature: 0.7,        \u002F\u002F Creativity (0-2, default varies by model)\n  maxOutputTokens: 1000,   \u002F\u002F Maximum tokens to generate\n  topP: 0.9,               \u002F\u002F Nucleus sampling parameter\n  frequencyPenalty: 0.5,   \u002F\u002F Reduce repetition\n  presencePenalty: 0.5,    \u002F\u002F Encourage new topics\n  stop: ['\\n\\n']           \u002F\u002F Stop sequences\n});\n```\n\n---\n\n## Streaming\n\nAll streaming methods support concurrent consumers from a single result object:\n\n```typescript\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Write a detailed explanation'\n});\n\n\u002F\u002F Consumer 1: Stream text to console\nconst textPromise = (async () => {\n  for await (const delta of result.getTextStream()) {\n    process.stdout.write(delta);\n  }\n})();\n\n\u002F\u002F Consumer 2: Get full response simultaneously\nconst responsePromise = result.getResponse();\n\n\u002F\u002F Both run concurrently\nconst [, response] = await Promise.all([textPromise, responsePromise]);\nconsole.log('\\n\\nTotal tokens:', response.usage.totalTokens);\n```\n\n### Streaming Tool Calls\n\n```typescript\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Search for information about TypeScript',\n  tools: [searchTool]\n});\n\nfor await (const toolCall of result.getToolCallsStream()) {\n  console.log(`Tool called: ${toolCall.name}`);\n  console.log(`Arguments: ${JSON.stringify(toolCall.arguments)}`);\n  console.log(`Result: ${JSON.stringify(toolCall.result)}`);\n}\n```\n\n---\n\n## Format Conversion\n\nConvert between ecosystem formats for interoperability:\n\n### OpenAI Format\n\n```typescript\nimport { fromChatMessages, toChatMessage } from '@openrouter\u002Fagent';\n\n\u002F\u002F OpenAI messages → OpenRouter format\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: fromChatMessages(openaiMessages)\n});\n\n\u002F\u002F Response → OpenAI chat message format\nconst response = await result.getResponse();\nconst chatMsg = toChatMessage(response);\n```\n\n### Claude Format\n\n```typescript\nimport { fromClaudeMessages, toClaudeMessage } from '@openrouter\u002Fagent';\n\n\u002F\u002F Claude messages → OpenRouter format\nconst result = client.callModel({\n  model: 'anthropic\u002Fclaude-3-opus',\n  input: fromClaudeMessages(claudeMessages)\n});\n\n\u002F\u002F Response → Claude message format\nconst response = await result.getResponse();\nconst claudeMsg = toClaudeMessage(response);\n```\n\n---\n\n## Responses API Message Shapes\n\nThe SDK uses the **OpenResponses** format for messages. Understanding these shapes is essential for building robust agents.\n\n### Message Roles\n\nMessages contain a `role` property that determines the message type:\n\n| Role | Description |\n|------|-------------|\n| `user` | User-provided input |\n| `assistant` | Model-generated responses |\n| `system` | System instructions |\n| `developer` | Developer-level directives |\n| `tool` | Tool execution results |\n\n### Text Message\n\nSimple text content from user or assistant:\n\n```typescript\ninterface TextMessage {\n  role: 'user' | 'assistant';\n  content: string;\n}\n```\n\n### Multimodal Message (Array Content)\n\nMessages with mixed content types:\n\n```typescript\ninterface MultimodalMessage {\n  role: 'user';\n  content: Array\u003C\n    | { type: 'input_text'; text: string }\n    | { type: 'input_image'; imageUrl: string; detail?: 'auto' | 'low' | 'high' }\n    | {\n        type: 'image';\n        source: {\n          type: 'url' | 'base64';\n          url?: string;\n          media_type?: string;\n          data?: string\n        }\n      }\n  >;\n}\n```\n\n### Tool Function Call Message\n\nWhen the model requests a tool execution:\n\n```typescript\ninterface ToolCallMessage {\n  role: 'assistant';\n  content?: null;\n  tool_calls?: Array\u003C{\n    id: string;\n    type: 'function';\n    function: {\n      name: string;\n      arguments: string;  \u002F\u002F JSON-encoded arguments\n    };\n  }>;\n}\n```\n\n### Tool Result Message\n\nResult returned after tool execution:\n\n```typescript\ninterface ToolResultMessage {\n  role: 'tool';\n  tool_call_id: string;\n  content: string;  \u002F\u002F JSON-encoded result\n}\n```\n\n### Non-Streaming Response Structure\n\nThe complete response object from `getResponse()`:\n\n```typescript\ninterface OpenResponsesNonStreamingResponse {\n  output: Array\u003CResponseMessage>;\n  usage?: {\n    inputTokens: number;\n    outputTokens: number;\n    cachedTokens?: number;\n  };\n  finishReason?: string;\n  warnings?: Array\u003C{\n    type: string;\n    message: string\n  }>;\n  experimental_providerMetadata?: Record\u003Cstring, unknown>;\n}\n```\n\n### Response Message Types\n\nOutput messages in the response array:\n\n```typescript\n\u002F\u002F Text\u002Fcontent message\ninterface ResponseOutputMessage {\n  type: 'message';\n  role: 'assistant';\n  content: string | Array\u003CContentPart>;\n  reasoning?: string;  \u002F\u002F For reasoning models (o1, etc.)\n}\n\n\u002F\u002F Tool result in output\ninterface FunctionCallOutputMessage {\n  type: 'function_call_output';\n  call_id: string;\n  output: string;\n}\n```\n\n### Parsed Tool Call\n\nWhen tool calls are parsed from the response:\n\n```typescript\ninterface ParsedToolCall {\n  id: string;\n  name: string;\n  arguments: unknown;  \u002F\u002F Validated against inputSchema\n}\n```\n\n### Tool Execution Result\n\nAfter a tool completes execution:\n\n```typescript\ninterface ToolExecutionResult {\n  toolCallId: string;\n  toolName: string;\n  result: unknown;                  \u002F\u002F Validated against outputSchema\n  preliminaryResults?: unknown[];   \u002F\u002F From generator tools\n  error?: Error;\n}\n```\n\n### Step Result (for Stop Conditions)\n\nAvailable in custom stop condition callbacks:\n\n```typescript\ninterface StepResult {\n  stepType: 'initial' | 'continue';\n  text: string;\n  toolCalls: ParsedToolCall[];\n  toolResults: ToolExecutionResult[];\n  response: OpenResponsesNonStreamingResponse;\n  usage?: {\n    inputTokens: number;\n    outputTokens: number;\n    cachedTokens?: number;\n  };\n  finishReason?: string;\n  warnings?: Array\u003C{ type: string; message: string }>;\n  experimental_providerMetadata?: Record\u003Cstring, unknown>;\n}\n```\n\n### TurnContext\n\nAvailable to tools and dynamic parameter functions:\n\n```typescript\ninterface TurnContext {\n  numberOfTurns: number;                     \u002F\u002F Turn count (1-indexed)\n  turnRequest?: OpenResponsesRequest;        \u002F\u002F Current request being made\n  toolCall?: OpenResponsesFunctionToolCall;  \u002F\u002F Current tool call (in tool context)\n}\n```\n\n---\n\n## Event Shapes\n\nThe SDK provides multiple streaming methods that yield different event types.\n\n### Response Stream Events\n\nThe `getFullResponsesStream()` method yields these event types:\n\n```typescript\ntype EnhancedResponseStreamEvent =\n  | ResponseCreatedEvent\n  | ResponseInProgressEvent\n  | OutputTextDeltaEvent\n  | OutputTextDoneEvent\n  | ReasoningDeltaEvent\n  | ReasoningDoneEvent\n  | FunctionCallArgumentsDeltaEvent\n  | FunctionCallArgumentsDoneEvent\n  | ResponseCompletedEvent\n  | ToolPreliminaryResultEvent;\n```\n\n### Event Type Reference\n\n| Event Type | Description | Payload |\n|------------|-------------|---------|\n| `response.created` | Response object initialized | `{ response: ResponseObject }` |\n| `response.in_progress` | Generation has started | `{}` |\n| `response.output_text.delta` | Text chunk received | `{ delta: string }` |\n| `response.output_text.done` | Text generation complete | `{ text: string }` |\n| `response.reasoning.delta` | Reasoning chunk (o1 models) | `{ delta: string }` |\n| `response.reasoning.done` | Reasoning complete | `{ reasoning: string }` |\n| `response.function_call_arguments.delta` | Tool argument chunk | `{ delta: string }` |\n| `response.function_call_arguments.done` | Tool arguments complete | `{ arguments: string }` |\n| `response.completed` | Full response complete | `{ response: ResponseObject }` |\n| `tool.preliminary_result` | Generator tool progress | `{ toolCallId: string; result: unknown }` |\n\n### Text Delta Event\n\n```typescript\ninterface OutputTextDeltaEvent {\n  type: 'response.output_text.delta';\n  delta: string;\n}\n```\n\n### Reasoning Delta Event\n\nFor reasoning models (o1, etc.):\n\n```typescript\ninterface ReasoningDeltaEvent {\n  type: 'response.reasoning.delta';\n  delta: string;\n}\n```\n\n### Function Call Arguments Delta Event\n\n```typescript\ninterface FunctionCallArgumentsDeltaEvent {\n  type: 'response.function_call_arguments.delta';\n  delta: string;\n}\n```\n\n### Tool Preliminary Result Event\n\nFrom generator tools that yield progress:\n\n```typescript\ninterface ToolPreliminaryResultEvent {\n  type: 'tool.preliminary_result';\n  toolCallId: string;\n  result: unknown;  \u002F\u002F Matches the tool's eventSchema\n}\n```\n\n### Response Completed Event\n\n```typescript\ninterface ResponseCompletedEvent {\n  type: 'response.completed';\n  response: OpenResponsesNonStreamingResponse;\n}\n```\n\n### Tool Stream Events\n\nThe `getToolStream()` method yields:\n\n```typescript\ntype ToolStreamEvent =\n  | { type: 'delta'; content: string }\n  | { type: 'preliminary_result'; toolCallId: string; result: unknown };\n```\n\n### Example: Processing Stream Events\n\n```typescript\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Analyze this data',\n  tools: [analysisTool]\n});\n\nfor await (const event of result.getFullResponsesStream()) {\n  switch (event.type) {\n    case 'response.output_text.delta':\n      process.stdout.write(event.delta);\n      break;\n\n    case 'response.reasoning.delta':\n      console.log('[Reasoning]', event.delta);\n      break;\n\n    case 'response.function_call_arguments.delta':\n      console.log('[Tool Args]', event.delta);\n      break;\n\n    case 'tool.preliminary_result':\n      console.log(`[Progress: ${event.toolCallId}]`, event.result);\n      break;\n\n    case 'response.completed':\n      console.log('\\n[Complete]', event.response.usage);\n      break;\n  }\n}\n```\n\n### Message Stream Events\n\nThe `getNewMessagesStream()` yields OpenResponses format updates:\n\n```typescript\ntype MessageStreamUpdate =\n  | ResponsesOutputMessage        \u002F\u002F Text\u002Fcontent updates\n  | OpenResponsesFunctionCallOutput;  \u002F\u002F Tool results\n```\n\n### Example: Tracking New Messages\n\n```typescript\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Research this topic',\n  tools: [searchTool]\n});\n\nconst allMessages: MessageStreamUpdate[] = [];\n\nfor await (const message of result.getNewMessagesStream()) {\n  allMessages.push(message);\n\n  if (message.type === 'message') {\n    console.log('Assistant:', message.content);\n  } else if (message.type === 'function_call_output') {\n    console.log('Tool result:', message.output);\n  }\n}\n```\n\n---\n\n## API Reference\n\n### Client Methods\n\nBeyond `callModel`, the SDK client (`@openrouter\u002Fsdk`) provides access to platform API endpoints:\n\n```typescript\nimport OpenRouter from '@openrouter\u002Fsdk';\n\nconst sdkClient = new OpenRouter({\n  apiKey: process.env.OPENROUTER_API_KEY\n});\n\n\u002F\u002F List available models\nconst models = await sdkClient.models.list();\n\n\u002F\u002F Chat completions (alternative to callModel)\nconst completion = await sdkClient.chat.send({\n  model: 'openai\u002Fgpt-5-nano',\n  messages: [{ role: 'user', content: 'Hello!' }]\n});\n\n\u002F\u002F Legacy completions format\nconst legacyCompletion = await sdkClient.completions.generate({\n  model: 'openai\u002Fgpt-5-nano',\n  prompt: 'Once upon a time'\n});\n\n\u002F\u002F Usage analytics\nconst activity = await sdkClient.analytics.getUserActivity();\n\n\u002F\u002F Credit balance\nconst credits = await sdkClient.credits.getCredits();\n\n\u002F\u002F API key management\nconst keys = await sdkClient.apiKeys.list();\n```\n\n---\n\n## Error Handling\n\nThe SDK provides specific error types with actionable messages:\n\n```typescript\ntry {\n  const result = await client.callModel({\n    model: 'openai\u002Fgpt-5-nano',\n    input: 'Hello!'\n  });\n  const text = await result.getText();\n} catch (error) {\n  if (error.statusCode === 401) {\n    console.error('Invalid API key - check your OPENROUTER_API_KEY');\n  } else if (error.statusCode === 402) {\n    console.error('Insufficient credits - add credits at openrouter.ai');\n  } else if (error.statusCode === 429) {\n    console.error('Rate limited - implement backoff retry');\n  } else if (error.statusCode === 503) {\n    console.error('Model temporarily unavailable - try again or use fallback');\n  } else {\n    console.error('Unexpected error:', error.message);\n  }\n}\n```\n\n### Error Status Codes\n\n| Code | Meaning | Action |\n|------|---------|--------|\n| 400 | Bad request | Check request parameters |\n| 401 | Unauthorized | Verify API key |\n| 402 | Payment required | Add credits |\n| 429 | Rate limited | Implement exponential backoff |\n| 500 | Server error | Retry with backoff |\n| 503 | Service unavailable | Try alternative model |\n\n---\n\n## Complete Example: Agent with Tools\n\n```typescript\nimport { OpenRouter } from '@openrouter\u002Fagent';\nimport { tool } from '@openrouter\u002Fagent\u002Ftool';\nimport { stepCountIs, hasToolCall } from '@openrouter\u002Fagent\u002Fstop-conditions';\nimport { z } from 'zod';\n\nconst client = new OpenRouter({\n  apiKey: process.env.OPENROUTER_API_KEY\n});\n\n\u002F\u002F Define tools\nconst searchTool = tool({\n  name: 'web_search',\n  description: 'Search the web for information',\n  inputSchema: z.object({\n    query: z.string().describe('Search query')\n  }),\n  outputSchema: z.object({\n    results: z.array(z.object({\n      title: z.string(),\n      snippet: z.string(),\n      url: z.string()\n    }))\n  }),\n  execute: async ({ query }) => {\n    \u002F\u002F Implement actual search\n    return {\n      results: [\n        { title: 'Example', snippet: 'Example result', url: 'https:\u002F\u002Fexample.com' }\n      ]\n    };\n  }\n});\n\nconst finishTool = tool({\n  name: 'finish',\n  description: 'Complete the task with final answer',\n  inputSchema: z.object({\n    answer: z.string().describe('The final answer')\n  }),\n  execute: async ({ answer }) => ({ answer })\n});\n\n\u002F\u002F Run agent\nasync function runAgent(task: string) {\n  const result = client.callModel({\n    model: 'openai\u002Fgpt-5-nano',\n    instructions: 'You are a helpful research assistant. Use web_search to find information, then use finish to provide your final answer.',\n    input: task,\n    tools: [searchTool, finishTool],\n    stopWhen: [\n      stepCountIs(10),\n      hasToolCall('finish')\n    ]\n  });\n\n  \u002F\u002F Stream progress\n  for await (const toolCall of result.getToolCallsStream()) {\n    console.log(`[${toolCall.name}] ${JSON.stringify(toolCall.arguments)}`);\n  }\n\n  return await result.getText();\n}\n\n\u002F\u002F Usage\nconst answer = await runAgent('What are the latest developments in quantum computing?');\nconsole.log('Final answer:', answer);\n```\n\n---\n\n## Best Practices\n\n### 1. Prefer callModel Over Direct API Calls\nThe `callModel` pattern provides automatic tool execution, type safety, and multi-turn handling.\n\n### 2. Use Zod for Tool Schemas\nZod provides runtime validation and excellent TypeScript inference:\n\n```typescript\nimport { z } from 'zod';\n\nconst schema = z.object({\n  name: z.string().min(1),\n  age: z.number().int().positive()\n});\n```\n\n### 3. Implement Stop Conditions\nAlways set reasonable limits to prevent runaway costs:\n\n```typescript\nstopWhen: [stepCountIs(20), maxCost(5.00)]\n```\n\n### 4. Handle Errors Gracefully\nImplement retry logic for transient failures:\n\n```typescript\nasync function callWithRetry(params, maxRetries = 3) {\n  for (let i = 0; i \u003C maxRetries; i++) {\n    try {\n      return await client.callModel(params).getText();\n    } catch (error) {\n      if (error.statusCode === 429 || error.statusCode >= 500) {\n        await sleep(Math.pow(2, i) * 1000);\n        continue;\n      }\n      throw error;\n    }\n  }\n}\n```\n\n### 5. Use Streaming for Long Responses\nStreaming provides better UX and allows early termination:\n\n```typescript\nfor await (const delta of result.getTextStream()) {\n  \u002F\u002F Process incrementally\n}\n```\n\n---\n\n## Additional Resources\n\n- **API Keys**: [openrouter.ai\u002Fsettings\u002Fkeys](https:\u002F\u002Fopenrouter.ai\u002Fsettings\u002Fkeys)\n- **Model List**: [openrouter.ai\u002Fmodels](https:\u002F\u002Fopenrouter.ai\u002Fmodels)\n- **Agent SDK**: [github.com\u002FOpenRouterTeam\u002Ftypescript-agent](https:\u002F\u002Fgithub.com\u002FOpenRouterTeam\u002Ftypescript-agent)\n- **SDK Issues**: [github.com\u002FOpenRouterTeam\u002Ftypescript-sdk\u002Fissues](https:\u002F\u002Fgithub.com\u002FOpenRouterTeam\u002Ftypescript-sdk\u002Fissues)\n\n---\n\n*SDK Status: Beta - Report issues on GitHub*\n",{"data":34,"body":36},{"name":4,"description":6,"version":35},"2.0.0",{"type":37,"children":38},"root",[39,47,62,67,116,120,127,207,213,229,388,391,397,402,409,414,421,445,451,480,486,615,620,743,749,761,1047,1053,1058,1582,1588,1593,1599,1604,1792,1800,1869,1877,1988,1994,1999,2266,2273,2329,2335,3983,3989,4052,4055,4061,4073,4079,4238,4244,4287,4290,4296,4309,4315,4320,4428,4434,4439,4722,4728,4733,5040,5046,5059,5196,5199,5205,5210,5317,5322,5500,5505,5766,5771,5989,5992,5998,6003,6009,6702,6708,6891,6897,6903,6908,7175,7181,7193,7808,7814,7827,8017,8020,8026,8031,8356,8362,8434,8440,8684,8687,8693,8698,8941,8947,9054,9057,9063,9068,9519,9525,9568,9571,9577,9582,9859,9862,9868,9873,10340,10346,10738,10741,10747,10752,10758,11009,11015,11266,11269,11275,11287,11293,11306,11410,11416,11421,11518,11524,11529,11956,11962,11967,12189,12195,12200,12301,12307,12318,12583,12589,12594,12854,12860,12865,12959,12965,12970,13116,13122,13127,13477,13483,13488,13595,13598,13604,13609,13615,13627,13777,13783,14066,14072,14149,14155,14160,14236,14242,14318,14324,14329,14428,14434,14510,14516,14528,14671,14677,15423,15429,15441,15502,15508,16009,16012,16018,16024,16043,16732,16735,16741,16746,17358,17364,17498,17501,17507,19220,19223,19229,19235,19246,19252,19257,19468,19474,19479,19542,19548,19553,19958,19964,19969,20038,20041,20047,20113,20116,20125],{"type":40,"tag":41,"props":42,"children":43},"element","h1",{"id":4},[44],{"type":45,"value":46},"text","OpenRouter TypeScript SDK",{"type":40,"tag":48,"props":49,"children":50},"p",{},[51,53,60],{"type":45,"value":52},"A comprehensive TypeScript SDK for interacting with OpenRouter's unified API, providing access to 300+ AI models through a single, type-safe interface. This skill enables AI agents to leverage the ",{"type":40,"tag":54,"props":55,"children":57},"code",{"className":56},[],[58],{"type":45,"value":59},"callModel",{"type":45,"value":61}," pattern for text generation, tool usage, streaming, and multi-turn conversations.",{"type":40,"tag":48,"props":63,"children":64},{},[65],{"type":45,"value":66},"The SDK is split into two packages:",{"type":40,"tag":68,"props":69,"children":70},"ul",{},[71,102],{"type":40,"tag":72,"props":73,"children":74},"li",{},[75,85,87,92,94,100],{"type":40,"tag":76,"props":77,"children":78},"strong",{},[79],{"type":40,"tag":54,"props":80,"children":82},{"className":81},[],[83],{"type":45,"value":84},"@openrouter\u002Fagent",{"type":45,"value":86}," — Agent features: ",{"type":40,"tag":54,"props":88,"children":90},{"className":89},[],[91],{"type":45,"value":59},{"type":45,"value":93},", ",{"type":40,"tag":54,"props":95,"children":97},{"className":96},[],[98],{"type":45,"value":99},"tool()",{"type":45,"value":101},", stop conditions, streaming, format converters",{"type":40,"tag":72,"props":103,"children":104},{},[105,114],{"type":40,"tag":76,"props":106,"children":107},{},[108],{"type":40,"tag":54,"props":109,"children":111},{"className":110},[],[112],{"type":45,"value":113},"@openrouter\u002Fsdk",{"type":45,"value":115}," — Platform features: model listing, chat completions, credits, OAuth, API key management",{"type":40,"tag":117,"props":118,"children":119},"hr",{},[],{"type":40,"tag":121,"props":122,"children":124},"h2",{"id":123},"installation",[125],{"type":45,"value":126},"Installation",{"type":40,"tag":128,"props":129,"children":134},"pre",{"className":130,"code":131,"language":132,"meta":133,"style":133},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# For agent features (callModel, tools, stop conditions)\nnpm install @openrouter\u002Fagent\n\n# For platform features (models, credits, OAuth, API keys)\nnpm install @openrouter\u002Fsdk\n","bash","",[135],{"type":40,"tag":54,"props":136,"children":137},{"__ignoreMap":133},[138,150,171,181,190],{"type":40,"tag":139,"props":140,"children":143},"span",{"class":141,"line":142},"line",1,[144],{"type":40,"tag":139,"props":145,"children":147},{"style":146},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[148],{"type":45,"value":149},"# For agent features (callModel, tools, stop conditions)\n",{"type":40,"tag":139,"props":151,"children":153},{"class":141,"line":152},2,[154,160,166],{"type":40,"tag":139,"props":155,"children":157},{"style":156},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[158],{"type":45,"value":159},"npm",{"type":40,"tag":139,"props":161,"children":163},{"style":162},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[164],{"type":45,"value":165}," install",{"type":40,"tag":139,"props":167,"children":168},{"style":162},[169],{"type":45,"value":170}," @openrouter\u002Fagent\n",{"type":40,"tag":139,"props":172,"children":174},{"class":141,"line":173},3,[175],{"type":40,"tag":139,"props":176,"children":178},{"emptyLinePlaceholder":177},true,[179],{"type":45,"value":180},"\n",{"type":40,"tag":139,"props":182,"children":184},{"class":141,"line":183},4,[185],{"type":40,"tag":139,"props":186,"children":187},{"style":146},[188],{"type":45,"value":189},"# For platform features (models, credits, OAuth, API keys)\n",{"type":40,"tag":139,"props":191,"children":193},{"class":141,"line":192},5,[194,198,202],{"type":40,"tag":139,"props":195,"children":196},{"style":156},[197],{"type":45,"value":159},{"type":40,"tag":139,"props":199,"children":200},{"style":162},[201],{"type":45,"value":165},{"type":40,"tag":139,"props":203,"children":204},{"style":162},[205],{"type":45,"value":206}," @openrouter\u002Fsdk\n",{"type":40,"tag":121,"props":208,"children":210},{"id":209},"setup",[211],{"type":45,"value":212},"Setup",{"type":40,"tag":48,"props":214,"children":215},{},[216,218,227],{"type":45,"value":217},"Get your API key from ",{"type":40,"tag":219,"props":220,"children":224},"a",{"href":221,"rel":222},"https:\u002F\u002Fopenrouter.ai\u002Fsettings\u002Fkeys",[223],"nofollow",[225],{"type":45,"value":226},"openrouter.ai\u002Fsettings\u002Fkeys",{"type":45,"value":228},", then initialize:",{"type":40,"tag":128,"props":230,"children":233},{"className":231,"code":232,"language":19,"meta":133,"style":133},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { OpenRouter } from '@openrouter\u002Fagent';\n\nconst client = new OpenRouter({\n  apiKey: process.env.OPENROUTER_API_KEY\n});\n",[234],{"type":40,"tag":54,"props":235,"children":236},{"__ignoreMap":133},[237,287,294,333,371],{"type":40,"tag":139,"props":238,"children":239},{"class":141,"line":142},[240,246,252,258,263,268,273,277,282],{"type":40,"tag":139,"props":241,"children":243},{"style":242},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[244],{"type":45,"value":245},"import",{"type":40,"tag":139,"props":247,"children":249},{"style":248},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[250],{"type":45,"value":251}," {",{"type":40,"tag":139,"props":253,"children":255},{"style":254},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[256],{"type":45,"value":257}," OpenRouter",{"type":40,"tag":139,"props":259,"children":260},{"style":248},[261],{"type":45,"value":262}," }",{"type":40,"tag":139,"props":264,"children":265},{"style":242},[266],{"type":45,"value":267}," from",{"type":40,"tag":139,"props":269,"children":270},{"style":248},[271],{"type":45,"value":272}," '",{"type":40,"tag":139,"props":274,"children":275},{"style":162},[276],{"type":45,"value":84},{"type":40,"tag":139,"props":278,"children":279},{"style":248},[280],{"type":45,"value":281},"'",{"type":40,"tag":139,"props":283,"children":284},{"style":248},[285],{"type":45,"value":286},";\n",{"type":40,"tag":139,"props":288,"children":289},{"class":141,"line":152},[290],{"type":40,"tag":139,"props":291,"children":292},{"emptyLinePlaceholder":177},[293],{"type":45,"value":180},{"type":40,"tag":139,"props":295,"children":296},{"class":141,"line":173},[297,303,308,313,318,323,328],{"type":40,"tag":139,"props":298,"children":300},{"style":299},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[301],{"type":45,"value":302},"const",{"type":40,"tag":139,"props":304,"children":305},{"style":254},[306],{"type":45,"value":307}," client ",{"type":40,"tag":139,"props":309,"children":310},{"style":248},[311],{"type":45,"value":312},"=",{"type":40,"tag":139,"props":314,"children":315},{"style":248},[316],{"type":45,"value":317}," new",{"type":40,"tag":139,"props":319,"children":321},{"style":320},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[322],{"type":45,"value":257},{"type":40,"tag":139,"props":324,"children":325},{"style":254},[326],{"type":45,"value":327},"(",{"type":40,"tag":139,"props":329,"children":330},{"style":248},[331],{"type":45,"value":332},"{\n",{"type":40,"tag":139,"props":334,"children":335},{"class":141,"line":183},[336,342,347,352,357,362,366],{"type":40,"tag":139,"props":337,"children":339},{"style":338},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[340],{"type":45,"value":341},"  apiKey",{"type":40,"tag":139,"props":343,"children":344},{"style":248},[345],{"type":45,"value":346},":",{"type":40,"tag":139,"props":348,"children":349},{"style":254},[350],{"type":45,"value":351}," process",{"type":40,"tag":139,"props":353,"children":354},{"style":248},[355],{"type":45,"value":356},".",{"type":40,"tag":139,"props":358,"children":359},{"style":254},[360],{"type":45,"value":361},"env",{"type":40,"tag":139,"props":363,"children":364},{"style":248},[365],{"type":45,"value":356},{"type":40,"tag":139,"props":367,"children":368},{"style":254},[369],{"type":45,"value":370},"OPENROUTER_API_KEY\n",{"type":40,"tag":139,"props":372,"children":373},{"class":141,"line":192},[374,379,384],{"type":40,"tag":139,"props":375,"children":376},{"style":248},[377],{"type":45,"value":378},"}",{"type":40,"tag":139,"props":380,"children":381},{"style":254},[382],{"type":45,"value":383},")",{"type":40,"tag":139,"props":385,"children":386},{"style":248},[387],{"type":45,"value":286},{"type":40,"tag":117,"props":389,"children":390},{},[],{"type":40,"tag":121,"props":392,"children":394},{"id":393},"authentication",[395],{"type":45,"value":396},"Authentication",{"type":40,"tag":48,"props":398,"children":399},{},[400],{"type":45,"value":401},"The SDK supports two authentication methods: API keys for server-side applications and OAuth PKCE flow for user-facing applications.",{"type":40,"tag":403,"props":404,"children":406},"h3",{"id":405},"api-key-authentication",[407],{"type":45,"value":408},"API Key Authentication",{"type":40,"tag":48,"props":410,"children":411},{},[412],{"type":45,"value":413},"The primary authentication method uses API keys from your OpenRouter account.",{"type":40,"tag":415,"props":416,"children":418},"h4",{"id":417},"obtaining-an-api-key",[419],{"type":45,"value":420},"Obtaining an API Key",{"type":40,"tag":422,"props":423,"children":424},"ol",{},[425,435,440],{"type":40,"tag":72,"props":426,"children":427},{},[428,430],{"type":45,"value":429},"Visit ",{"type":40,"tag":219,"props":431,"children":433},{"href":221,"rel":432},[223],[434],{"type":45,"value":226},{"type":40,"tag":72,"props":436,"children":437},{},[438],{"type":45,"value":439},"Create a new API key",{"type":40,"tag":72,"props":441,"children":442},{},[443],{"type":45,"value":444},"Store securely in an environment variable",{"type":40,"tag":415,"props":446,"children":448},{"id":447},"environment-setup",[449],{"type":45,"value":450},"Environment Setup",{"type":40,"tag":128,"props":452,"children":454},{"className":130,"code":453,"language":132,"meta":133,"style":133},"export OPENROUTER_API_KEY=sk-or-v1-your-key-here\n",[455],{"type":40,"tag":54,"props":456,"children":457},{"__ignoreMap":133},[458],{"type":40,"tag":139,"props":459,"children":460},{"class":141,"line":142},[461,466,471,475],{"type":40,"tag":139,"props":462,"children":463},{"style":299},[464],{"type":45,"value":465},"export",{"type":40,"tag":139,"props":467,"children":468},{"style":254},[469],{"type":45,"value":470}," OPENROUTER_API_KEY",{"type":40,"tag":139,"props":472,"children":473},{"style":248},[474],{"type":45,"value":312},{"type":40,"tag":139,"props":476,"children":477},{"style":254},[478],{"type":45,"value":479},"sk-or-v1-your-key-here\n",{"type":40,"tag":415,"props":481,"children":483},{"id":482},"client-initialization",[484],{"type":45,"value":485},"Client Initialization",{"type":40,"tag":128,"props":487,"children":488},{"className":231,"code":232,"language":19,"meta":133,"style":133},[489],{"type":40,"tag":54,"props":490,"children":491},{"__ignoreMap":133},[492,531,538,569,600],{"type":40,"tag":139,"props":493,"children":494},{"class":141,"line":142},[495,499,503,507,511,515,519,523,527],{"type":40,"tag":139,"props":496,"children":497},{"style":242},[498],{"type":45,"value":245},{"type":40,"tag":139,"props":500,"children":501},{"style":248},[502],{"type":45,"value":251},{"type":40,"tag":139,"props":504,"children":505},{"style":254},[506],{"type":45,"value":257},{"type":40,"tag":139,"props":508,"children":509},{"style":248},[510],{"type":45,"value":262},{"type":40,"tag":139,"props":512,"children":513},{"style":242},[514],{"type":45,"value":267},{"type":40,"tag":139,"props":516,"children":517},{"style":248},[518],{"type":45,"value":272},{"type":40,"tag":139,"props":520,"children":521},{"style":162},[522],{"type":45,"value":84},{"type":40,"tag":139,"props":524,"children":525},{"style":248},[526],{"type":45,"value":281},{"type":40,"tag":139,"props":528,"children":529},{"style":248},[530],{"type":45,"value":286},{"type":40,"tag":139,"props":532,"children":533},{"class":141,"line":152},[534],{"type":40,"tag":139,"props":535,"children":536},{"emptyLinePlaceholder":177},[537],{"type":45,"value":180},{"type":40,"tag":139,"props":539,"children":540},{"class":141,"line":173},[541,545,549,553,557,561,565],{"type":40,"tag":139,"props":542,"children":543},{"style":299},[544],{"type":45,"value":302},{"type":40,"tag":139,"props":546,"children":547},{"style":254},[548],{"type":45,"value":307},{"type":40,"tag":139,"props":550,"children":551},{"style":248},[552],{"type":45,"value":312},{"type":40,"tag":139,"props":554,"children":555},{"style":248},[556],{"type":45,"value":317},{"type":40,"tag":139,"props":558,"children":559},{"style":320},[560],{"type":45,"value":257},{"type":40,"tag":139,"props":562,"children":563},{"style":254},[564],{"type":45,"value":327},{"type":40,"tag":139,"props":566,"children":567},{"style":248},[568],{"type":45,"value":332},{"type":40,"tag":139,"props":570,"children":571},{"class":141,"line":183},[572,576,580,584,588,592,596],{"type":40,"tag":139,"props":573,"children":574},{"style":338},[575],{"type":45,"value":341},{"type":40,"tag":139,"props":577,"children":578},{"style":248},[579],{"type":45,"value":346},{"type":40,"tag":139,"props":581,"children":582},{"style":254},[583],{"type":45,"value":351},{"type":40,"tag":139,"props":585,"children":586},{"style":248},[587],{"type":45,"value":356},{"type":40,"tag":139,"props":589,"children":590},{"style":254},[591],{"type":45,"value":361},{"type":40,"tag":139,"props":593,"children":594},{"style":248},[595],{"type":45,"value":356},{"type":40,"tag":139,"props":597,"children":598},{"style":254},[599],{"type":45,"value":370},{"type":40,"tag":139,"props":601,"children":602},{"class":141,"line":192},[603,607,611],{"type":40,"tag":139,"props":604,"children":605},{"style":248},[606],{"type":45,"value":378},{"type":40,"tag":139,"props":608,"children":609},{"style":254},[610],{"type":45,"value":383},{"type":40,"tag":139,"props":612,"children":613},{"style":248},[614],{"type":45,"value":286},{"type":40,"tag":48,"props":616,"children":617},{},[618],{"type":45,"value":619},"The client automatically uses this key for all subsequent requests:",{"type":40,"tag":128,"props":621,"children":623},{"className":231,"code":622,"language":19,"meta":133,"style":133},"\u002F\u002F API key is automatically included\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Hello!'\n});\n",[624],{"type":40,"tag":54,"props":625,"children":626},{"__ignoreMap":133},[627,635,672,702,728],{"type":40,"tag":139,"props":628,"children":629},{"class":141,"line":142},[630],{"type":40,"tag":139,"props":631,"children":632},{"style":146},[633],{"type":45,"value":634},"\u002F\u002F API key is automatically included\n",{"type":40,"tag":139,"props":636,"children":637},{"class":141,"line":152},[638,642,647,651,656,660,664,668],{"type":40,"tag":139,"props":639,"children":640},{"style":299},[641],{"type":45,"value":302},{"type":40,"tag":139,"props":643,"children":644},{"style":254},[645],{"type":45,"value":646}," result ",{"type":40,"tag":139,"props":648,"children":649},{"style":248},[650],{"type":45,"value":312},{"type":40,"tag":139,"props":652,"children":653},{"style":254},[654],{"type":45,"value":655}," client",{"type":40,"tag":139,"props":657,"children":658},{"style":248},[659],{"type":45,"value":356},{"type":40,"tag":139,"props":661,"children":662},{"style":320},[663],{"type":45,"value":59},{"type":40,"tag":139,"props":665,"children":666},{"style":254},[667],{"type":45,"value":327},{"type":40,"tag":139,"props":669,"children":670},{"style":248},[671],{"type":45,"value":332},{"type":40,"tag":139,"props":673,"children":674},{"class":141,"line":173},[675,680,684,688,693,697],{"type":40,"tag":139,"props":676,"children":677},{"style":338},[678],{"type":45,"value":679},"  model",{"type":40,"tag":139,"props":681,"children":682},{"style":248},[683],{"type":45,"value":346},{"type":40,"tag":139,"props":685,"children":686},{"style":248},[687],{"type":45,"value":272},{"type":40,"tag":139,"props":689,"children":690},{"style":162},[691],{"type":45,"value":692},"openai\u002Fgpt-5-nano",{"type":40,"tag":139,"props":694,"children":695},{"style":248},[696],{"type":45,"value":281},{"type":40,"tag":139,"props":698,"children":699},{"style":248},[700],{"type":45,"value":701},",\n",{"type":40,"tag":139,"props":703,"children":704},{"class":141,"line":183},[705,710,714,718,723],{"type":40,"tag":139,"props":706,"children":707},{"style":338},[708],{"type":45,"value":709},"  input",{"type":40,"tag":139,"props":711,"children":712},{"style":248},[713],{"type":45,"value":346},{"type":40,"tag":139,"props":715,"children":716},{"style":248},[717],{"type":45,"value":272},{"type":40,"tag":139,"props":719,"children":720},{"style":162},[721],{"type":45,"value":722},"Hello!",{"type":40,"tag":139,"props":724,"children":725},{"style":248},[726],{"type":45,"value":727},"'\n",{"type":40,"tag":139,"props":729,"children":730},{"class":141,"line":192},[731,735,739],{"type":40,"tag":139,"props":732,"children":733},{"style":248},[734],{"type":45,"value":378},{"type":40,"tag":139,"props":736,"children":737},{"style":254},[738],{"type":45,"value":383},{"type":40,"tag":139,"props":740,"children":741},{"style":248},[742],{"type":45,"value":286},{"type":40,"tag":415,"props":744,"children":746},{"id":745},"get-current-key-metadata",[747],{"type":45,"value":748},"Get Current Key Metadata",{"type":40,"tag":48,"props":750,"children":751},{},[752,754,759],{"type":45,"value":753},"Retrieve information about the currently configured API key (requires ",{"type":40,"tag":54,"props":755,"children":757},{"className":756},[],[758],{"type":45,"value":113},{"type":45,"value":760},"):",{"type":40,"tag":128,"props":762,"children":764},{"className":231,"code":763,"language":19,"meta":133,"style":133},"import OpenRouter from '@openrouter\u002Fsdk';\nconst sdkClient = new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY });\n\nconst keyInfo = await sdkClient.apiKeys.getCurrentKeyMetadata();\nconsole.log('Key name:', keyInfo.name);\nconsole.log('Created:', keyInfo.createdAt);\n",[765],{"type":40,"tag":54,"props":766,"children":767},{"__ignoreMap":133},[768,801,876,883,936,993],{"type":40,"tag":139,"props":769,"children":770},{"class":141,"line":142},[771,775,780,785,789,793,797],{"type":40,"tag":139,"props":772,"children":773},{"style":242},[774],{"type":45,"value":245},{"type":40,"tag":139,"props":776,"children":777},{"style":254},[778],{"type":45,"value":779}," OpenRouter ",{"type":40,"tag":139,"props":781,"children":782},{"style":242},[783],{"type":45,"value":784},"from",{"type":40,"tag":139,"props":786,"children":787},{"style":248},[788],{"type":45,"value":272},{"type":40,"tag":139,"props":790,"children":791},{"style":162},[792],{"type":45,"value":113},{"type":40,"tag":139,"props":794,"children":795},{"style":248},[796],{"type":45,"value":281},{"type":40,"tag":139,"props":798,"children":799},{"style":248},[800],{"type":45,"value":286},{"type":40,"tag":139,"props":802,"children":803},{"class":141,"line":152},[804,808,813,817,821,825,829,834,839,843,847,851,855,859,864,868,872],{"type":40,"tag":139,"props":805,"children":806},{"style":299},[807],{"type":45,"value":302},{"type":40,"tag":139,"props":809,"children":810},{"style":254},[811],{"type":45,"value":812}," sdkClient ",{"type":40,"tag":139,"props":814,"children":815},{"style":248},[816],{"type":45,"value":312},{"type":40,"tag":139,"props":818,"children":819},{"style":248},[820],{"type":45,"value":317},{"type":40,"tag":139,"props":822,"children":823},{"style":320},[824],{"type":45,"value":257},{"type":40,"tag":139,"props":826,"children":827},{"style":254},[828],{"type":45,"value":327},{"type":40,"tag":139,"props":830,"children":831},{"style":248},[832],{"type":45,"value":833},"{",{"type":40,"tag":139,"props":835,"children":836},{"style":338},[837],{"type":45,"value":838}," apiKey",{"type":40,"tag":139,"props":840,"children":841},{"style":248},[842],{"type":45,"value":346},{"type":40,"tag":139,"props":844,"children":845},{"style":254},[846],{"type":45,"value":351},{"type":40,"tag":139,"props":848,"children":849},{"style":248},[850],{"type":45,"value":356},{"type":40,"tag":139,"props":852,"children":853},{"style":254},[854],{"type":45,"value":361},{"type":40,"tag":139,"props":856,"children":857},{"style":248},[858],{"type":45,"value":356},{"type":40,"tag":139,"props":860,"children":861},{"style":254},[862],{"type":45,"value":863},"OPENROUTER_API_KEY ",{"type":40,"tag":139,"props":865,"children":866},{"style":248},[867],{"type":45,"value":378},{"type":40,"tag":139,"props":869,"children":870},{"style":254},[871],{"type":45,"value":383},{"type":40,"tag":139,"props":873,"children":874},{"style":248},[875],{"type":45,"value":286},{"type":40,"tag":139,"props":877,"children":878},{"class":141,"line":173},[879],{"type":40,"tag":139,"props":880,"children":881},{"emptyLinePlaceholder":177},[882],{"type":45,"value":180},{"type":40,"tag":139,"props":884,"children":885},{"class":141,"line":183},[886,890,895,899,904,909,913,918,922,927,932],{"type":40,"tag":139,"props":887,"children":888},{"style":299},[889],{"type":45,"value":302},{"type":40,"tag":139,"props":891,"children":892},{"style":254},[893],{"type":45,"value":894}," keyInfo ",{"type":40,"tag":139,"props":896,"children":897},{"style":248},[898],{"type":45,"value":312},{"type":40,"tag":139,"props":900,"children":901},{"style":242},[902],{"type":45,"value":903}," await",{"type":40,"tag":139,"props":905,"children":906},{"style":254},[907],{"type":45,"value":908}," sdkClient",{"type":40,"tag":139,"props":910,"children":911},{"style":248},[912],{"type":45,"value":356},{"type":40,"tag":139,"props":914,"children":915},{"style":254},[916],{"type":45,"value":917},"apiKeys",{"type":40,"tag":139,"props":919,"children":920},{"style":248},[921],{"type":45,"value":356},{"type":40,"tag":139,"props":923,"children":924},{"style":320},[925],{"type":45,"value":926},"getCurrentKeyMetadata",{"type":40,"tag":139,"props":928,"children":929},{"style":254},[930],{"type":45,"value":931},"()",{"type":40,"tag":139,"props":933,"children":934},{"style":248},[935],{"type":45,"value":286},{"type":40,"tag":139,"props":937,"children":938},{"class":141,"line":192},[939,944,948,953,957,961,966,970,975,980,984,989],{"type":40,"tag":139,"props":940,"children":941},{"style":254},[942],{"type":45,"value":943},"console",{"type":40,"tag":139,"props":945,"children":946},{"style":248},[947],{"type":45,"value":356},{"type":40,"tag":139,"props":949,"children":950},{"style":320},[951],{"type":45,"value":952},"log",{"type":40,"tag":139,"props":954,"children":955},{"style":254},[956],{"type":45,"value":327},{"type":40,"tag":139,"props":958,"children":959},{"style":248},[960],{"type":45,"value":281},{"type":40,"tag":139,"props":962,"children":963},{"style":162},[964],{"type":45,"value":965},"Key name:",{"type":40,"tag":139,"props":967,"children":968},{"style":248},[969],{"type":45,"value":281},{"type":40,"tag":139,"props":971,"children":972},{"style":248},[973],{"type":45,"value":974},",",{"type":40,"tag":139,"props":976,"children":977},{"style":254},[978],{"type":45,"value":979}," keyInfo",{"type":40,"tag":139,"props":981,"children":982},{"style":248},[983],{"type":45,"value":356},{"type":40,"tag":139,"props":985,"children":986},{"style":254},[987],{"type":45,"value":988},"name)",{"type":40,"tag":139,"props":990,"children":991},{"style":248},[992],{"type":45,"value":286},{"type":40,"tag":139,"props":994,"children":996},{"class":141,"line":995},6,[997,1001,1005,1009,1013,1017,1022,1026,1030,1034,1038,1043],{"type":40,"tag":139,"props":998,"children":999},{"style":254},[1000],{"type":45,"value":943},{"type":40,"tag":139,"props":1002,"children":1003},{"style":248},[1004],{"type":45,"value":356},{"type":40,"tag":139,"props":1006,"children":1007},{"style":320},[1008],{"type":45,"value":952},{"type":40,"tag":139,"props":1010,"children":1011},{"style":254},[1012],{"type":45,"value":327},{"type":40,"tag":139,"props":1014,"children":1015},{"style":248},[1016],{"type":45,"value":281},{"type":40,"tag":139,"props":1018,"children":1019},{"style":162},[1020],{"type":45,"value":1021},"Created:",{"type":40,"tag":139,"props":1023,"children":1024},{"style":248},[1025],{"type":45,"value":281},{"type":40,"tag":139,"props":1027,"children":1028},{"style":248},[1029],{"type":45,"value":974},{"type":40,"tag":139,"props":1031,"children":1032},{"style":254},[1033],{"type":45,"value":979},{"type":40,"tag":139,"props":1035,"children":1036},{"style":248},[1037],{"type":45,"value":356},{"type":40,"tag":139,"props":1039,"children":1040},{"style":254},[1041],{"type":45,"value":1042},"createdAt)",{"type":40,"tag":139,"props":1044,"children":1045},{"style":248},[1046],{"type":45,"value":286},{"type":40,"tag":415,"props":1048,"children":1050},{"id":1049},"api-key-management",[1051],{"type":45,"value":1052},"API Key Management",{"type":40,"tag":48,"props":1054,"children":1055},{},[1056],{"type":45,"value":1057},"Programmatically manage API keys:",{"type":40,"tag":128,"props":1059,"children":1061},{"className":231,"code":1060,"language":19,"meta":133,"style":133},"\u002F\u002F List all keys\nconst keys = await client.apiKeys.list();\n\n\u002F\u002F Create a new key\nconst newKey = await client.apiKeys.create({\n  name: 'Production API Key'\n});\n\n\u002F\u002F Get a specific key by hash\nconst key = await client.apiKeys.get({\n  hash: 'sk-or-v1-...'\n});\n\n\u002F\u002F Update a key\nawait client.apiKeys.update({\n  hash: 'sk-or-v1-...',\n  requestBody: {\n    name: 'Updated Key Name'\n  }\n});\n\n\u002F\u002F Delete a key\nawait client.apiKeys.delete({\n  hash: 'sk-or-v1-...'\n});\n",[1062],{"type":40,"tag":54,"props":1063,"children":1064},{"__ignoreMap":133},[1065,1073,1122,1129,1137,1186,1211,1227,1235,1244,1294,1320,1336,1344,1353,1391,1419,1437,1463,1472,1488,1496,1505,1542,1566],{"type":40,"tag":139,"props":1066,"children":1067},{"class":141,"line":142},[1068],{"type":40,"tag":139,"props":1069,"children":1070},{"style":146},[1071],{"type":45,"value":1072},"\u002F\u002F List all keys\n",{"type":40,"tag":139,"props":1074,"children":1075},{"class":141,"line":152},[1076,1080,1085,1089,1093,1097,1101,1105,1109,1114,1118],{"type":40,"tag":139,"props":1077,"children":1078},{"style":299},[1079],{"type":45,"value":302},{"type":40,"tag":139,"props":1081,"children":1082},{"style":254},[1083],{"type":45,"value":1084}," keys ",{"type":40,"tag":139,"props":1086,"children":1087},{"style":248},[1088],{"type":45,"value":312},{"type":40,"tag":139,"props":1090,"children":1091},{"style":242},[1092],{"type":45,"value":903},{"type":40,"tag":139,"props":1094,"children":1095},{"style":254},[1096],{"type":45,"value":655},{"type":40,"tag":139,"props":1098,"children":1099},{"style":248},[1100],{"type":45,"value":356},{"type":40,"tag":139,"props":1102,"children":1103},{"style":254},[1104],{"type":45,"value":917},{"type":40,"tag":139,"props":1106,"children":1107},{"style":248},[1108],{"type":45,"value":356},{"type":40,"tag":139,"props":1110,"children":1111},{"style":320},[1112],{"type":45,"value":1113},"list",{"type":40,"tag":139,"props":1115,"children":1116},{"style":254},[1117],{"type":45,"value":931},{"type":40,"tag":139,"props":1119,"children":1120},{"style":248},[1121],{"type":45,"value":286},{"type":40,"tag":139,"props":1123,"children":1124},{"class":141,"line":173},[1125],{"type":40,"tag":139,"props":1126,"children":1127},{"emptyLinePlaceholder":177},[1128],{"type":45,"value":180},{"type":40,"tag":139,"props":1130,"children":1131},{"class":141,"line":183},[1132],{"type":40,"tag":139,"props":1133,"children":1134},{"style":146},[1135],{"type":45,"value":1136},"\u002F\u002F Create a new key\n",{"type":40,"tag":139,"props":1138,"children":1139},{"class":141,"line":192},[1140,1144,1149,1153,1157,1161,1165,1169,1173,1178,1182],{"type":40,"tag":139,"props":1141,"children":1142},{"style":299},[1143],{"type":45,"value":302},{"type":40,"tag":139,"props":1145,"children":1146},{"style":254},[1147],{"type":45,"value":1148}," newKey ",{"type":40,"tag":139,"props":1150,"children":1151},{"style":248},[1152],{"type":45,"value":312},{"type":40,"tag":139,"props":1154,"children":1155},{"style":242},[1156],{"type":45,"value":903},{"type":40,"tag":139,"props":1158,"children":1159},{"style":254},[1160],{"type":45,"value":655},{"type":40,"tag":139,"props":1162,"children":1163},{"style":248},[1164],{"type":45,"value":356},{"type":40,"tag":139,"props":1166,"children":1167},{"style":254},[1168],{"type":45,"value":917},{"type":40,"tag":139,"props":1170,"children":1171},{"style":248},[1172],{"type":45,"value":356},{"type":40,"tag":139,"props":1174,"children":1175},{"style":320},[1176],{"type":45,"value":1177},"create",{"type":40,"tag":139,"props":1179,"children":1180},{"style":254},[1181],{"type":45,"value":327},{"type":40,"tag":139,"props":1183,"children":1184},{"style":248},[1185],{"type":45,"value":332},{"type":40,"tag":139,"props":1187,"children":1188},{"class":141,"line":995},[1189,1194,1198,1202,1207],{"type":40,"tag":139,"props":1190,"children":1191},{"style":338},[1192],{"type":45,"value":1193},"  name",{"type":40,"tag":139,"props":1195,"children":1196},{"style":248},[1197],{"type":45,"value":346},{"type":40,"tag":139,"props":1199,"children":1200},{"style":248},[1201],{"type":45,"value":272},{"type":40,"tag":139,"props":1203,"children":1204},{"style":162},[1205],{"type":45,"value":1206},"Production API Key",{"type":40,"tag":139,"props":1208,"children":1209},{"style":248},[1210],{"type":45,"value":727},{"type":40,"tag":139,"props":1212,"children":1214},{"class":141,"line":1213},7,[1215,1219,1223],{"type":40,"tag":139,"props":1216,"children":1217},{"style":248},[1218],{"type":45,"value":378},{"type":40,"tag":139,"props":1220,"children":1221},{"style":254},[1222],{"type":45,"value":383},{"type":40,"tag":139,"props":1224,"children":1225},{"style":248},[1226],{"type":45,"value":286},{"type":40,"tag":139,"props":1228,"children":1230},{"class":141,"line":1229},8,[1231],{"type":40,"tag":139,"props":1232,"children":1233},{"emptyLinePlaceholder":177},[1234],{"type":45,"value":180},{"type":40,"tag":139,"props":1236,"children":1238},{"class":141,"line":1237},9,[1239],{"type":40,"tag":139,"props":1240,"children":1241},{"style":146},[1242],{"type":45,"value":1243},"\u002F\u002F Get a specific key by hash\n",{"type":40,"tag":139,"props":1245,"children":1247},{"class":141,"line":1246},10,[1248,1252,1257,1261,1265,1269,1273,1277,1281,1286,1290],{"type":40,"tag":139,"props":1249,"children":1250},{"style":299},[1251],{"type":45,"value":302},{"type":40,"tag":139,"props":1253,"children":1254},{"style":254},[1255],{"type":45,"value":1256}," key ",{"type":40,"tag":139,"props":1258,"children":1259},{"style":248},[1260],{"type":45,"value":312},{"type":40,"tag":139,"props":1262,"children":1263},{"style":242},[1264],{"type":45,"value":903},{"type":40,"tag":139,"props":1266,"children":1267},{"style":254},[1268],{"type":45,"value":655},{"type":40,"tag":139,"props":1270,"children":1271},{"style":248},[1272],{"type":45,"value":356},{"type":40,"tag":139,"props":1274,"children":1275},{"style":254},[1276],{"type":45,"value":917},{"type":40,"tag":139,"props":1278,"children":1279},{"style":248},[1280],{"type":45,"value":356},{"type":40,"tag":139,"props":1282,"children":1283},{"style":320},[1284],{"type":45,"value":1285},"get",{"type":40,"tag":139,"props":1287,"children":1288},{"style":254},[1289],{"type":45,"value":327},{"type":40,"tag":139,"props":1291,"children":1292},{"style":248},[1293],{"type":45,"value":332},{"type":40,"tag":139,"props":1295,"children":1297},{"class":141,"line":1296},11,[1298,1303,1307,1311,1316],{"type":40,"tag":139,"props":1299,"children":1300},{"style":338},[1301],{"type":45,"value":1302},"  hash",{"type":40,"tag":139,"props":1304,"children":1305},{"style":248},[1306],{"type":45,"value":346},{"type":40,"tag":139,"props":1308,"children":1309},{"style":248},[1310],{"type":45,"value":272},{"type":40,"tag":139,"props":1312,"children":1313},{"style":162},[1314],{"type":45,"value":1315},"sk-or-v1-...",{"type":40,"tag":139,"props":1317,"children":1318},{"style":248},[1319],{"type":45,"value":727},{"type":40,"tag":139,"props":1321,"children":1323},{"class":141,"line":1322},12,[1324,1328,1332],{"type":40,"tag":139,"props":1325,"children":1326},{"style":248},[1327],{"type":45,"value":378},{"type":40,"tag":139,"props":1329,"children":1330},{"style":254},[1331],{"type":45,"value":383},{"type":40,"tag":139,"props":1333,"children":1334},{"style":248},[1335],{"type":45,"value":286},{"type":40,"tag":139,"props":1337,"children":1339},{"class":141,"line":1338},13,[1340],{"type":40,"tag":139,"props":1341,"children":1342},{"emptyLinePlaceholder":177},[1343],{"type":45,"value":180},{"type":40,"tag":139,"props":1345,"children":1347},{"class":141,"line":1346},14,[1348],{"type":40,"tag":139,"props":1349,"children":1350},{"style":146},[1351],{"type":45,"value":1352},"\u002F\u002F Update a key\n",{"type":40,"tag":139,"props":1354,"children":1356},{"class":141,"line":1355},15,[1357,1362,1366,1370,1374,1378,1383,1387],{"type":40,"tag":139,"props":1358,"children":1359},{"style":242},[1360],{"type":45,"value":1361},"await",{"type":40,"tag":139,"props":1363,"children":1364},{"style":254},[1365],{"type":45,"value":655},{"type":40,"tag":139,"props":1367,"children":1368},{"style":248},[1369],{"type":45,"value":356},{"type":40,"tag":139,"props":1371,"children":1372},{"style":254},[1373],{"type":45,"value":917},{"type":40,"tag":139,"props":1375,"children":1376},{"style":248},[1377],{"type":45,"value":356},{"type":40,"tag":139,"props":1379,"children":1380},{"style":320},[1381],{"type":45,"value":1382},"update",{"type":40,"tag":139,"props":1384,"children":1385},{"style":254},[1386],{"type":45,"value":327},{"type":40,"tag":139,"props":1388,"children":1389},{"style":248},[1390],{"type":45,"value":332},{"type":40,"tag":139,"props":1392,"children":1394},{"class":141,"line":1393},16,[1395,1399,1403,1407,1411,1415],{"type":40,"tag":139,"props":1396,"children":1397},{"style":338},[1398],{"type":45,"value":1302},{"type":40,"tag":139,"props":1400,"children":1401},{"style":248},[1402],{"type":45,"value":346},{"type":40,"tag":139,"props":1404,"children":1405},{"style":248},[1406],{"type":45,"value":272},{"type":40,"tag":139,"props":1408,"children":1409},{"style":162},[1410],{"type":45,"value":1315},{"type":40,"tag":139,"props":1412,"children":1413},{"style":248},[1414],{"type":45,"value":281},{"type":40,"tag":139,"props":1416,"children":1417},{"style":248},[1418],{"type":45,"value":701},{"type":40,"tag":139,"props":1420,"children":1422},{"class":141,"line":1421},17,[1423,1428,1432],{"type":40,"tag":139,"props":1424,"children":1425},{"style":338},[1426],{"type":45,"value":1427},"  requestBody",{"type":40,"tag":139,"props":1429,"children":1430},{"style":248},[1431],{"type":45,"value":346},{"type":40,"tag":139,"props":1433,"children":1434},{"style":248},[1435],{"type":45,"value":1436}," {\n",{"type":40,"tag":139,"props":1438,"children":1440},{"class":141,"line":1439},18,[1441,1446,1450,1454,1459],{"type":40,"tag":139,"props":1442,"children":1443},{"style":338},[1444],{"type":45,"value":1445},"    name",{"type":40,"tag":139,"props":1447,"children":1448},{"style":248},[1449],{"type":45,"value":346},{"type":40,"tag":139,"props":1451,"children":1452},{"style":248},[1453],{"type":45,"value":272},{"type":40,"tag":139,"props":1455,"children":1456},{"style":162},[1457],{"type":45,"value":1458},"Updated Key Name",{"type":40,"tag":139,"props":1460,"children":1461},{"style":248},[1462],{"type":45,"value":727},{"type":40,"tag":139,"props":1464,"children":1466},{"class":141,"line":1465},19,[1467],{"type":40,"tag":139,"props":1468,"children":1469},{"style":248},[1470],{"type":45,"value":1471},"  }\n",{"type":40,"tag":139,"props":1473,"children":1475},{"class":141,"line":1474},20,[1476,1480,1484],{"type":40,"tag":139,"props":1477,"children":1478},{"style":248},[1479],{"type":45,"value":378},{"type":40,"tag":139,"props":1481,"children":1482},{"style":254},[1483],{"type":45,"value":383},{"type":40,"tag":139,"props":1485,"children":1486},{"style":248},[1487],{"type":45,"value":286},{"type":40,"tag":139,"props":1489,"children":1491},{"class":141,"line":1490},21,[1492],{"type":40,"tag":139,"props":1493,"children":1494},{"emptyLinePlaceholder":177},[1495],{"type":45,"value":180},{"type":40,"tag":139,"props":1497,"children":1499},{"class":141,"line":1498},22,[1500],{"type":40,"tag":139,"props":1501,"children":1502},{"style":146},[1503],{"type":45,"value":1504},"\u002F\u002F Delete a key\n",{"type":40,"tag":139,"props":1506,"children":1508},{"class":141,"line":1507},23,[1509,1513,1517,1521,1525,1529,1534,1538],{"type":40,"tag":139,"props":1510,"children":1511},{"style":242},[1512],{"type":45,"value":1361},{"type":40,"tag":139,"props":1514,"children":1515},{"style":254},[1516],{"type":45,"value":655},{"type":40,"tag":139,"props":1518,"children":1519},{"style":248},[1520],{"type":45,"value":356},{"type":40,"tag":139,"props":1522,"children":1523},{"style":254},[1524],{"type":45,"value":917},{"type":40,"tag":139,"props":1526,"children":1527},{"style":248},[1528],{"type":45,"value":356},{"type":40,"tag":139,"props":1530,"children":1531},{"style":320},[1532],{"type":45,"value":1533},"delete",{"type":40,"tag":139,"props":1535,"children":1536},{"style":254},[1537],{"type":45,"value":327},{"type":40,"tag":139,"props":1539,"children":1540},{"style":248},[1541],{"type":45,"value":332},{"type":40,"tag":139,"props":1543,"children":1545},{"class":141,"line":1544},24,[1546,1550,1554,1558,1562],{"type":40,"tag":139,"props":1547,"children":1548},{"style":338},[1549],{"type":45,"value":1302},{"type":40,"tag":139,"props":1551,"children":1552},{"style":248},[1553],{"type":45,"value":346},{"type":40,"tag":139,"props":1555,"children":1556},{"style":248},[1557],{"type":45,"value":272},{"type":40,"tag":139,"props":1559,"children":1560},{"style":162},[1561],{"type":45,"value":1315},{"type":40,"tag":139,"props":1563,"children":1564},{"style":248},[1565],{"type":45,"value":727},{"type":40,"tag":139,"props":1567,"children":1569},{"class":141,"line":1568},25,[1570,1574,1578],{"type":40,"tag":139,"props":1571,"children":1572},{"style":248},[1573],{"type":45,"value":378},{"type":40,"tag":139,"props":1575,"children":1576},{"style":254},[1577],{"type":45,"value":383},{"type":40,"tag":139,"props":1579,"children":1580},{"style":248},[1581],{"type":45,"value":286},{"type":40,"tag":403,"props":1583,"children":1585},{"id":1584},"oauth-authentication-pkce-flow",[1586],{"type":45,"value":1587},"OAuth Authentication (PKCE Flow)",{"type":40,"tag":48,"props":1589,"children":1590},{},[1591],{"type":45,"value":1592},"For user-facing applications where users should control their own API keys, OpenRouter supports OAuth with PKCE (Proof Key for Code Exchange). This flow allows users to generate API keys through a browser authorization flow without your application handling their credentials.",{"type":40,"tag":415,"props":1594,"children":1596},{"id":1595},"createauthcode",[1597],{"type":45,"value":1598},"createAuthCode",{"type":40,"tag":48,"props":1600,"children":1601},{},[1602],{"type":45,"value":1603},"Generate an authorization code and URL to start the OAuth flow:",{"type":40,"tag":128,"props":1605,"children":1607},{"className":231,"code":1606,"language":19,"meta":133,"style":133},"const authResponse = await client.oAuth.createAuthCode({\n  callbackUrl: 'https:\u002F\u002Fmyapp.com\u002Fauth\u002Fcallback'\n});\n\n\u002F\u002F authResponse contains:\n\u002F\u002F - authorizationUrl: URL to redirect the user to\n\u002F\u002F - code: The authorization code for later exchange\n\nconsole.log('Redirect user to:', authResponse.authorizationUrl);\n",[1608],{"type":40,"tag":54,"props":1609,"children":1610},{"__ignoreMap":133},[1611,1660,1685,1700,1707,1715,1723,1731,1738],{"type":40,"tag":139,"props":1612,"children":1613},{"class":141,"line":142},[1614,1618,1623,1627,1631,1635,1639,1644,1648,1652,1656],{"type":40,"tag":139,"props":1615,"children":1616},{"style":299},[1617],{"type":45,"value":302},{"type":40,"tag":139,"props":1619,"children":1620},{"style":254},[1621],{"type":45,"value":1622}," authResponse ",{"type":40,"tag":139,"props":1624,"children":1625},{"style":248},[1626],{"type":45,"value":312},{"type":40,"tag":139,"props":1628,"children":1629},{"style":242},[1630],{"type":45,"value":903},{"type":40,"tag":139,"props":1632,"children":1633},{"style":254},[1634],{"type":45,"value":655},{"type":40,"tag":139,"props":1636,"children":1637},{"style":248},[1638],{"type":45,"value":356},{"type":40,"tag":139,"props":1640,"children":1641},{"style":254},[1642],{"type":45,"value":1643},"oAuth",{"type":40,"tag":139,"props":1645,"children":1646},{"style":248},[1647],{"type":45,"value":356},{"type":40,"tag":139,"props":1649,"children":1650},{"style":320},[1651],{"type":45,"value":1598},{"type":40,"tag":139,"props":1653,"children":1654},{"style":254},[1655],{"type":45,"value":327},{"type":40,"tag":139,"props":1657,"children":1658},{"style":248},[1659],{"type":45,"value":332},{"type":40,"tag":139,"props":1661,"children":1662},{"class":141,"line":152},[1663,1668,1672,1676,1681],{"type":40,"tag":139,"props":1664,"children":1665},{"style":338},[1666],{"type":45,"value":1667},"  callbackUrl",{"type":40,"tag":139,"props":1669,"children":1670},{"style":248},[1671],{"type":45,"value":346},{"type":40,"tag":139,"props":1673,"children":1674},{"style":248},[1675],{"type":45,"value":272},{"type":40,"tag":139,"props":1677,"children":1678},{"style":162},[1679],{"type":45,"value":1680},"https:\u002F\u002Fmyapp.com\u002Fauth\u002Fcallback",{"type":40,"tag":139,"props":1682,"children":1683},{"style":248},[1684],{"type":45,"value":727},{"type":40,"tag":139,"props":1686,"children":1687},{"class":141,"line":173},[1688,1692,1696],{"type":40,"tag":139,"props":1689,"children":1690},{"style":248},[1691],{"type":45,"value":378},{"type":40,"tag":139,"props":1693,"children":1694},{"style":254},[1695],{"type":45,"value":383},{"type":40,"tag":139,"props":1697,"children":1698},{"style":248},[1699],{"type":45,"value":286},{"type":40,"tag":139,"props":1701,"children":1702},{"class":141,"line":183},[1703],{"type":40,"tag":139,"props":1704,"children":1705},{"emptyLinePlaceholder":177},[1706],{"type":45,"value":180},{"type":40,"tag":139,"props":1708,"children":1709},{"class":141,"line":192},[1710],{"type":40,"tag":139,"props":1711,"children":1712},{"style":146},[1713],{"type":45,"value":1714},"\u002F\u002F authResponse contains:\n",{"type":40,"tag":139,"props":1716,"children":1717},{"class":141,"line":995},[1718],{"type":40,"tag":139,"props":1719,"children":1720},{"style":146},[1721],{"type":45,"value":1722},"\u002F\u002F - authorizationUrl: URL to redirect the user to\n",{"type":40,"tag":139,"props":1724,"children":1725},{"class":141,"line":1213},[1726],{"type":40,"tag":139,"props":1727,"children":1728},{"style":146},[1729],{"type":45,"value":1730},"\u002F\u002F - code: The authorization code for later exchange\n",{"type":40,"tag":139,"props":1732,"children":1733},{"class":141,"line":1229},[1734],{"type":40,"tag":139,"props":1735,"children":1736},{"emptyLinePlaceholder":177},[1737],{"type":45,"value":180},{"type":40,"tag":139,"props":1739,"children":1740},{"class":141,"line":1237},[1741,1745,1749,1753,1757,1761,1766,1770,1774,1779,1783,1788],{"type":40,"tag":139,"props":1742,"children":1743},{"style":254},[1744],{"type":45,"value":943},{"type":40,"tag":139,"props":1746,"children":1747},{"style":248},[1748],{"type":45,"value":356},{"type":40,"tag":139,"props":1750,"children":1751},{"style":320},[1752],{"type":45,"value":952},{"type":40,"tag":139,"props":1754,"children":1755},{"style":254},[1756],{"type":45,"value":327},{"type":40,"tag":139,"props":1758,"children":1759},{"style":248},[1760],{"type":45,"value":281},{"type":40,"tag":139,"props":1762,"children":1763},{"style":162},[1764],{"type":45,"value":1765},"Redirect user to:",{"type":40,"tag":139,"props":1767,"children":1768},{"style":248},[1769],{"type":45,"value":281},{"type":40,"tag":139,"props":1771,"children":1772},{"style":248},[1773],{"type":45,"value":974},{"type":40,"tag":139,"props":1775,"children":1776},{"style":254},[1777],{"type":45,"value":1778}," authResponse",{"type":40,"tag":139,"props":1780,"children":1781},{"style":248},[1782],{"type":45,"value":356},{"type":40,"tag":139,"props":1784,"children":1785},{"style":254},[1786],{"type":45,"value":1787},"authorizationUrl)",{"type":40,"tag":139,"props":1789,"children":1790},{"style":248},[1791],{"type":45,"value":286},{"type":40,"tag":48,"props":1793,"children":1794},{},[1795],{"type":40,"tag":76,"props":1796,"children":1797},{},[1798],{"type":45,"value":1799},"Parameters:",{"type":40,"tag":1801,"props":1802,"children":1803},"table",{},[1804,1833],{"type":40,"tag":1805,"props":1806,"children":1807},"thead",{},[1808],{"type":40,"tag":1809,"props":1810,"children":1811},"tr",{},[1812,1818,1823,1828],{"type":40,"tag":1813,"props":1814,"children":1815},"th",{},[1816],{"type":45,"value":1817},"Parameter",{"type":40,"tag":1813,"props":1819,"children":1820},{},[1821],{"type":45,"value":1822},"Type",{"type":40,"tag":1813,"props":1824,"children":1825},{},[1826],{"type":45,"value":1827},"Required",{"type":40,"tag":1813,"props":1829,"children":1830},{},[1831],{"type":45,"value":1832},"Description",{"type":40,"tag":1834,"props":1835,"children":1836},"tbody",{},[1837],{"type":40,"tag":1809,"props":1838,"children":1839},{},[1840,1850,1859,1864],{"type":40,"tag":1841,"props":1842,"children":1843},"td",{},[1844],{"type":40,"tag":54,"props":1845,"children":1847},{"className":1846},[],[1848],{"type":45,"value":1849},"callbackUrl",{"type":40,"tag":1841,"props":1851,"children":1852},{},[1853],{"type":40,"tag":54,"props":1854,"children":1856},{"className":1855},[],[1857],{"type":45,"value":1858},"string",{"type":40,"tag":1841,"props":1860,"children":1861},{},[1862],{"type":45,"value":1863},"Yes",{"type":40,"tag":1841,"props":1865,"children":1866},{},[1867],{"type":45,"value":1868},"Your application's callback URL after user authorization",{"type":40,"tag":48,"props":1870,"children":1871},{},[1872],{"type":40,"tag":76,"props":1873,"children":1874},{},[1875],{"type":45,"value":1876},"Browser Redirect:",{"type":40,"tag":128,"props":1878,"children":1880},{"className":231,"code":1879,"language":19,"meta":133,"style":133},"\u002F\u002F In a browser environment\nwindow.location.href = authResponse.authorizationUrl;\n\n\u002F\u002F Or in a server-rendered app, return a redirect response\nres.redirect(authResponse.authorizationUrl);\n",[1881],{"type":40,"tag":54,"props":1882,"children":1883},{"__ignoreMap":133},[1884,1892,1939,1946,1954],{"type":40,"tag":139,"props":1885,"children":1886},{"class":141,"line":142},[1887],{"type":40,"tag":139,"props":1888,"children":1889},{"style":146},[1890],{"type":45,"value":1891},"\u002F\u002F In a browser environment\n",{"type":40,"tag":139,"props":1893,"children":1894},{"class":141,"line":152},[1895,1900,1904,1909,1913,1918,1922,1926,1930,1935],{"type":40,"tag":139,"props":1896,"children":1897},{"style":254},[1898],{"type":45,"value":1899},"window",{"type":40,"tag":139,"props":1901,"children":1902},{"style":248},[1903],{"type":45,"value":356},{"type":40,"tag":139,"props":1905,"children":1906},{"style":254},[1907],{"type":45,"value":1908},"location",{"type":40,"tag":139,"props":1910,"children":1911},{"style":248},[1912],{"type":45,"value":356},{"type":40,"tag":139,"props":1914,"children":1915},{"style":254},[1916],{"type":45,"value":1917},"href ",{"type":40,"tag":139,"props":1919,"children":1920},{"style":248},[1921],{"type":45,"value":312},{"type":40,"tag":139,"props":1923,"children":1924},{"style":254},[1925],{"type":45,"value":1778},{"type":40,"tag":139,"props":1927,"children":1928},{"style":248},[1929],{"type":45,"value":356},{"type":40,"tag":139,"props":1931,"children":1932},{"style":254},[1933],{"type":45,"value":1934},"authorizationUrl",{"type":40,"tag":139,"props":1936,"children":1937},{"style":248},[1938],{"type":45,"value":286},{"type":40,"tag":139,"props":1940,"children":1941},{"class":141,"line":173},[1942],{"type":40,"tag":139,"props":1943,"children":1944},{"emptyLinePlaceholder":177},[1945],{"type":45,"value":180},{"type":40,"tag":139,"props":1947,"children":1948},{"class":141,"line":183},[1949],{"type":40,"tag":139,"props":1950,"children":1951},{"style":146},[1952],{"type":45,"value":1953},"\u002F\u002F Or in a server-rendered app, return a redirect response\n",{"type":40,"tag":139,"props":1955,"children":1956},{"class":141,"line":192},[1957,1962,1966,1971,1976,1980,1984],{"type":40,"tag":139,"props":1958,"children":1959},{"style":254},[1960],{"type":45,"value":1961},"res",{"type":40,"tag":139,"props":1963,"children":1964},{"style":248},[1965],{"type":45,"value":356},{"type":40,"tag":139,"props":1967,"children":1968},{"style":320},[1969],{"type":45,"value":1970},"redirect",{"type":40,"tag":139,"props":1972,"children":1973},{"style":254},[1974],{"type":45,"value":1975},"(authResponse",{"type":40,"tag":139,"props":1977,"children":1978},{"style":248},[1979],{"type":45,"value":356},{"type":40,"tag":139,"props":1981,"children":1982},{"style":254},[1983],{"type":45,"value":1787},{"type":40,"tag":139,"props":1985,"children":1986},{"style":248},[1987],{"type":45,"value":286},{"type":40,"tag":415,"props":1989,"children":1991},{"id":1990},"exchangeauthcodeforapikey",[1992],{"type":45,"value":1993},"exchangeAuthCodeForAPIKey",{"type":40,"tag":48,"props":1995,"children":1996},{},[1997],{"type":45,"value":1998},"After the user authorizes your application, they are redirected back to your callback URL with an authorization code. Exchange this code for an API key:",{"type":40,"tag":128,"props":2000,"children":2002},{"className":231,"code":2001,"language":19,"meta":133,"style":133},"\u002F\u002F In your callback handler\nconst code = req.query.code;  \u002F\u002F From the redirect URL\n\nconst apiKeyResponse = await client.oAuth.exchangeAuthCodeForAPIKey({\n  code: code\n});\n\n\u002F\u002F apiKeyResponse contains:\n\u002F\u002F - key: The user's API key\n\u002F\u002F - Additional metadata about the key\n\nconst userApiKey = apiKeyResponse.key;\n\n\u002F\u002F Store securely for this user's future requests\nawait saveUserApiKey(userId, userApiKey);\n",[2003],{"type":40,"tag":54,"props":2004,"children":2005},{"__ignoreMap":133},[2006,2014,2062,2069,2117,2134,2149,2156,2164,2172,2180,2187,2221,2228,2236],{"type":40,"tag":139,"props":2007,"children":2008},{"class":141,"line":142},[2009],{"type":40,"tag":139,"props":2010,"children":2011},{"style":146},[2012],{"type":45,"value":2013},"\u002F\u002F In your callback handler\n",{"type":40,"tag":139,"props":2015,"children":2016},{"class":141,"line":152},[2017,2021,2026,2030,2035,2039,2044,2048,2052,2057],{"type":40,"tag":139,"props":2018,"children":2019},{"style":299},[2020],{"type":45,"value":302},{"type":40,"tag":139,"props":2022,"children":2023},{"style":254},[2024],{"type":45,"value":2025}," code ",{"type":40,"tag":139,"props":2027,"children":2028},{"style":248},[2029],{"type":45,"value":312},{"type":40,"tag":139,"props":2031,"children":2032},{"style":254},[2033],{"type":45,"value":2034}," req",{"type":40,"tag":139,"props":2036,"children":2037},{"style":248},[2038],{"type":45,"value":356},{"type":40,"tag":139,"props":2040,"children":2041},{"style":254},[2042],{"type":45,"value":2043},"query",{"type":40,"tag":139,"props":2045,"children":2046},{"style":248},[2047],{"type":45,"value":356},{"type":40,"tag":139,"props":2049,"children":2050},{"style":254},[2051],{"type":45,"value":54},{"type":40,"tag":139,"props":2053,"children":2054},{"style":248},[2055],{"type":45,"value":2056},";",{"type":40,"tag":139,"props":2058,"children":2059},{"style":146},[2060],{"type":45,"value":2061},"  \u002F\u002F From the redirect URL\n",{"type":40,"tag":139,"props":2063,"children":2064},{"class":141,"line":173},[2065],{"type":40,"tag":139,"props":2066,"children":2067},{"emptyLinePlaceholder":177},[2068],{"type":45,"value":180},{"type":40,"tag":139,"props":2070,"children":2071},{"class":141,"line":183},[2072,2076,2081,2085,2089,2093,2097,2101,2105,2109,2113],{"type":40,"tag":139,"props":2073,"children":2074},{"style":299},[2075],{"type":45,"value":302},{"type":40,"tag":139,"props":2077,"children":2078},{"style":254},[2079],{"type":45,"value":2080}," apiKeyResponse ",{"type":40,"tag":139,"props":2082,"children":2083},{"style":248},[2084],{"type":45,"value":312},{"type":40,"tag":139,"props":2086,"children":2087},{"style":242},[2088],{"type":45,"value":903},{"type":40,"tag":139,"props":2090,"children":2091},{"style":254},[2092],{"type":45,"value":655},{"type":40,"tag":139,"props":2094,"children":2095},{"style":248},[2096],{"type":45,"value":356},{"type":40,"tag":139,"props":2098,"children":2099},{"style":254},[2100],{"type":45,"value":1643},{"type":40,"tag":139,"props":2102,"children":2103},{"style":248},[2104],{"type":45,"value":356},{"type":40,"tag":139,"props":2106,"children":2107},{"style":320},[2108],{"type":45,"value":1993},{"type":40,"tag":139,"props":2110,"children":2111},{"style":254},[2112],{"type":45,"value":327},{"type":40,"tag":139,"props":2114,"children":2115},{"style":248},[2116],{"type":45,"value":332},{"type":40,"tag":139,"props":2118,"children":2119},{"class":141,"line":192},[2120,2125,2129],{"type":40,"tag":139,"props":2121,"children":2122},{"style":338},[2123],{"type":45,"value":2124},"  code",{"type":40,"tag":139,"props":2126,"children":2127},{"style":248},[2128],{"type":45,"value":346},{"type":40,"tag":139,"props":2130,"children":2131},{"style":254},[2132],{"type":45,"value":2133}," code\n",{"type":40,"tag":139,"props":2135,"children":2136},{"class":141,"line":995},[2137,2141,2145],{"type":40,"tag":139,"props":2138,"children":2139},{"style":248},[2140],{"type":45,"value":378},{"type":40,"tag":139,"props":2142,"children":2143},{"style":254},[2144],{"type":45,"value":383},{"type":40,"tag":139,"props":2146,"children":2147},{"style":248},[2148],{"type":45,"value":286},{"type":40,"tag":139,"props":2150,"children":2151},{"class":141,"line":1213},[2152],{"type":40,"tag":139,"props":2153,"children":2154},{"emptyLinePlaceholder":177},[2155],{"type":45,"value":180},{"type":40,"tag":139,"props":2157,"children":2158},{"class":141,"line":1229},[2159],{"type":40,"tag":139,"props":2160,"children":2161},{"style":146},[2162],{"type":45,"value":2163},"\u002F\u002F apiKeyResponse contains:\n",{"type":40,"tag":139,"props":2165,"children":2166},{"class":141,"line":1237},[2167],{"type":40,"tag":139,"props":2168,"children":2169},{"style":146},[2170],{"type":45,"value":2171},"\u002F\u002F - key: The user's API key\n",{"type":40,"tag":139,"props":2173,"children":2174},{"class":141,"line":1246},[2175],{"type":40,"tag":139,"props":2176,"children":2177},{"style":146},[2178],{"type":45,"value":2179},"\u002F\u002F - Additional metadata about the key\n",{"type":40,"tag":139,"props":2181,"children":2182},{"class":141,"line":1296},[2183],{"type":40,"tag":139,"props":2184,"children":2185},{"emptyLinePlaceholder":177},[2186],{"type":45,"value":180},{"type":40,"tag":139,"props":2188,"children":2189},{"class":141,"line":1322},[2190,2194,2199,2203,2208,2212,2217],{"type":40,"tag":139,"props":2191,"children":2192},{"style":299},[2193],{"type":45,"value":302},{"type":40,"tag":139,"props":2195,"children":2196},{"style":254},[2197],{"type":45,"value":2198}," userApiKey ",{"type":40,"tag":139,"props":2200,"children":2201},{"style":248},[2202],{"type":45,"value":312},{"type":40,"tag":139,"props":2204,"children":2205},{"style":254},[2206],{"type":45,"value":2207}," apiKeyResponse",{"type":40,"tag":139,"props":2209,"children":2210},{"style":248},[2211],{"type":45,"value":356},{"type":40,"tag":139,"props":2213,"children":2214},{"style":254},[2215],{"type":45,"value":2216},"key",{"type":40,"tag":139,"props":2218,"children":2219},{"style":248},[2220],{"type":45,"value":286},{"type":40,"tag":139,"props":2222,"children":2223},{"class":141,"line":1338},[2224],{"type":40,"tag":139,"props":2225,"children":2226},{"emptyLinePlaceholder":177},[2227],{"type":45,"value":180},{"type":40,"tag":139,"props":2229,"children":2230},{"class":141,"line":1346},[2231],{"type":40,"tag":139,"props":2232,"children":2233},{"style":146},[2234],{"type":45,"value":2235},"\u002F\u002F Store securely for this user's future requests\n",{"type":40,"tag":139,"props":2237,"children":2238},{"class":141,"line":1355},[2239,2243,2248,2253,2257,2262],{"type":40,"tag":139,"props":2240,"children":2241},{"style":242},[2242],{"type":45,"value":1361},{"type":40,"tag":139,"props":2244,"children":2245},{"style":320},[2246],{"type":45,"value":2247}," saveUserApiKey",{"type":40,"tag":139,"props":2249,"children":2250},{"style":254},[2251],{"type":45,"value":2252},"(userId",{"type":40,"tag":139,"props":2254,"children":2255},{"style":248},[2256],{"type":45,"value":974},{"type":40,"tag":139,"props":2258,"children":2259},{"style":254},[2260],{"type":45,"value":2261}," userApiKey)",{"type":40,"tag":139,"props":2263,"children":2264},{"style":248},[2265],{"type":45,"value":286},{"type":40,"tag":48,"props":2267,"children":2268},{},[2269],{"type":40,"tag":76,"props":2270,"children":2271},{},[2272],{"type":45,"value":1799},{"type":40,"tag":1801,"props":2274,"children":2275},{},[2276,2298],{"type":40,"tag":1805,"props":2277,"children":2278},{},[2279],{"type":40,"tag":1809,"props":2280,"children":2281},{},[2282,2286,2290,2294],{"type":40,"tag":1813,"props":2283,"children":2284},{},[2285],{"type":45,"value":1817},{"type":40,"tag":1813,"props":2287,"children":2288},{},[2289],{"type":45,"value":1822},{"type":40,"tag":1813,"props":2291,"children":2292},{},[2293],{"type":45,"value":1827},{"type":40,"tag":1813,"props":2295,"children":2296},{},[2297],{"type":45,"value":1832},{"type":40,"tag":1834,"props":2299,"children":2300},{},[2301],{"type":40,"tag":1809,"props":2302,"children":2303},{},[2304,2312,2320,2324],{"type":40,"tag":1841,"props":2305,"children":2306},{},[2307],{"type":40,"tag":54,"props":2308,"children":2310},{"className":2309},[],[2311],{"type":45,"value":54},{"type":40,"tag":1841,"props":2313,"children":2314},{},[2315],{"type":40,"tag":54,"props":2316,"children":2318},{"className":2317},[],[2319],{"type":45,"value":1858},{"type":40,"tag":1841,"props":2321,"children":2322},{},[2323],{"type":45,"value":1863},{"type":40,"tag":1841,"props":2325,"children":2326},{},[2327],{"type":45,"value":2328},"The authorization code from the OAuth redirect",{"type":40,"tag":415,"props":2330,"children":2332},{"id":2331},"complete-oauth-flow-example",[2333],{"type":45,"value":2334},"Complete OAuth Flow Example",{"type":40,"tag":128,"props":2336,"children":2338},{"className":231,"code":2337,"language":19,"meta":133,"style":133},"import OpenRouter from '@openrouter\u002Fsdk';\nimport { OpenRouter as Agent } from '@openrouter\u002Fagent';\nimport express from 'express';\n\nconst app = express();\n\u002F\u002F SDK client for OAuth and API key management\nconst client = new OpenRouter({\n  apiKey: process.env.OPENROUTER_API_KEY\n});\n\n\u002F\u002F Step 1: Initiate OAuth flow\napp.get('\u002Fauth\u002Fstart', async (req, res) => {\n  const authResponse = await client.oAuth.createAuthCode({\n    callbackUrl: 'https:\u002F\u002Fmyapp.com\u002Fauth\u002Fcallback'\n  });\n\n  \u002F\u002F Store any state needed for the callback\n  req.session.oauthState = { \u002F* ... *\u002F };\n\n  \u002F\u002F Redirect user to OpenRouter authorization page\n  res.redirect(authResponse.authorizationUrl);\n});\n\n\u002F\u002F Step 2: Handle callback and exchange code\napp.get('\u002Fauth\u002Fcallback', async (req, res) => {\n  const { code } = req.query;\n\n  if (!code) {\n    return res.status(400).send('Authorization code missing');\n  }\n\n  try {\n    const apiKeyResponse = await client.oAuth.exchangeAuthCodeForAPIKey({\n      code: code as string\n    });\n\n    \u002F\u002F Store the user's API key securely\n    await saveUserApiKey(req.session.userId, apiKeyResponse.key);\n\n    res.redirect('\u002Fdashboard?auth=success');\n  } catch (error) {\n    console.error('OAuth exchange failed:', error);\n    res.redirect('\u002Fauth\u002Ferror');\n  }\n});\n\n\u002F\u002F Step 3: Use the user's API key for their requests\napp.post('\u002Fapi\u002Fchat', async (req, res) => {\n  const userApiKey = await getUserApiKey(req.session.userId);\n\n  \u002F\u002F Create an agent client with the user's key\n  const userAgent = new Agent({\n    apiKey: userApiKey\n  });\n\n  const result = userAgent.callModel({\n    model: 'openai\u002Fgpt-5-nano',\n    input: req.body.message\n  });\n\n  const text = await result.getText();\n  res.json({ response: text });\n});\n",[2339],{"type":40,"tag":54,"props":2340,"children":2341},{"__ignoreMap":133},[2342,2373,2422,2455,2462,2491,2499,2530,2561,2576,2583,2591,2666,2715,2739,2755,2762,2770,2814,2821,2829,2870,2885,2892,2900,2968,3008,3016,3047,3117,3125,3133,3146,3195,3221,3238,3246,3255,3317,3325,3367,3397,3448,3489,3497,3513,3521,3530,3600,3658,3666,3675,3708,3726,3742,3750,3787,3816,3851,3867,3875,3917,3967],{"type":40,"tag":139,"props":2343,"children":2344},{"class":141,"line":142},[2345,2349,2353,2357,2361,2365,2369],{"type":40,"tag":139,"props":2346,"children":2347},{"style":242},[2348],{"type":45,"value":245},{"type":40,"tag":139,"props":2350,"children":2351},{"style":254},[2352],{"type":45,"value":779},{"type":40,"tag":139,"props":2354,"children":2355},{"style":242},[2356],{"type":45,"value":784},{"type":40,"tag":139,"props":2358,"children":2359},{"style":248},[2360],{"type":45,"value":272},{"type":40,"tag":139,"props":2362,"children":2363},{"style":162},[2364],{"type":45,"value":113},{"type":40,"tag":139,"props":2366,"children":2367},{"style":248},[2368],{"type":45,"value":281},{"type":40,"tag":139,"props":2370,"children":2371},{"style":248},[2372],{"type":45,"value":286},{"type":40,"tag":139,"props":2374,"children":2375},{"class":141,"line":152},[2376,2380,2384,2388,2393,2398,2402,2406,2410,2414,2418],{"type":40,"tag":139,"props":2377,"children":2378},{"style":242},[2379],{"type":45,"value":245},{"type":40,"tag":139,"props":2381,"children":2382},{"style":248},[2383],{"type":45,"value":251},{"type":40,"tag":139,"props":2385,"children":2386},{"style":254},[2387],{"type":45,"value":257},{"type":40,"tag":139,"props":2389,"children":2390},{"style":242},[2391],{"type":45,"value":2392}," as",{"type":40,"tag":139,"props":2394,"children":2395},{"style":254},[2396],{"type":45,"value":2397}," Agent",{"type":40,"tag":139,"props":2399,"children":2400},{"style":248},[2401],{"type":45,"value":262},{"type":40,"tag":139,"props":2403,"children":2404},{"style":242},[2405],{"type":45,"value":267},{"type":40,"tag":139,"props":2407,"children":2408},{"style":248},[2409],{"type":45,"value":272},{"type":40,"tag":139,"props":2411,"children":2412},{"style":162},[2413],{"type":45,"value":84},{"type":40,"tag":139,"props":2415,"children":2416},{"style":248},[2417],{"type":45,"value":281},{"type":40,"tag":139,"props":2419,"children":2420},{"style":248},[2421],{"type":45,"value":286},{"type":40,"tag":139,"props":2423,"children":2424},{"class":141,"line":173},[2425,2429,2434,2438,2442,2447,2451],{"type":40,"tag":139,"props":2426,"children":2427},{"style":242},[2428],{"type":45,"value":245},{"type":40,"tag":139,"props":2430,"children":2431},{"style":254},[2432],{"type":45,"value":2433}," express ",{"type":40,"tag":139,"props":2435,"children":2436},{"style":242},[2437],{"type":45,"value":784},{"type":40,"tag":139,"props":2439,"children":2440},{"style":248},[2441],{"type":45,"value":272},{"type":40,"tag":139,"props":2443,"children":2444},{"style":162},[2445],{"type":45,"value":2446},"express",{"type":40,"tag":139,"props":2448,"children":2449},{"style":248},[2450],{"type":45,"value":281},{"type":40,"tag":139,"props":2452,"children":2453},{"style":248},[2454],{"type":45,"value":286},{"type":40,"tag":139,"props":2456,"children":2457},{"class":141,"line":183},[2458],{"type":40,"tag":139,"props":2459,"children":2460},{"emptyLinePlaceholder":177},[2461],{"type":45,"value":180},{"type":40,"tag":139,"props":2463,"children":2464},{"class":141,"line":192},[2465,2469,2474,2478,2483,2487],{"type":40,"tag":139,"props":2466,"children":2467},{"style":299},[2468],{"type":45,"value":302},{"type":40,"tag":139,"props":2470,"children":2471},{"style":254},[2472],{"type":45,"value":2473}," app ",{"type":40,"tag":139,"props":2475,"children":2476},{"style":248},[2477],{"type":45,"value":312},{"type":40,"tag":139,"props":2479,"children":2480},{"style":320},[2481],{"type":45,"value":2482}," express",{"type":40,"tag":139,"props":2484,"children":2485},{"style":254},[2486],{"type":45,"value":931},{"type":40,"tag":139,"props":2488,"children":2489},{"style":248},[2490],{"type":45,"value":286},{"type":40,"tag":139,"props":2492,"children":2493},{"class":141,"line":995},[2494],{"type":40,"tag":139,"props":2495,"children":2496},{"style":146},[2497],{"type":45,"value":2498},"\u002F\u002F SDK client for OAuth and API key management\n",{"type":40,"tag":139,"props":2500,"children":2501},{"class":141,"line":1213},[2502,2506,2510,2514,2518,2522,2526],{"type":40,"tag":139,"props":2503,"children":2504},{"style":299},[2505],{"type":45,"value":302},{"type":40,"tag":139,"props":2507,"children":2508},{"style":254},[2509],{"type":45,"value":307},{"type":40,"tag":139,"props":2511,"children":2512},{"style":248},[2513],{"type":45,"value":312},{"type":40,"tag":139,"props":2515,"children":2516},{"style":248},[2517],{"type":45,"value":317},{"type":40,"tag":139,"props":2519,"children":2520},{"style":320},[2521],{"type":45,"value":257},{"type":40,"tag":139,"props":2523,"children":2524},{"style":254},[2525],{"type":45,"value":327},{"type":40,"tag":139,"props":2527,"children":2528},{"style":248},[2529],{"type":45,"value":332},{"type":40,"tag":139,"props":2531,"children":2532},{"class":141,"line":1229},[2533,2537,2541,2545,2549,2553,2557],{"type":40,"tag":139,"props":2534,"children":2535},{"style":338},[2536],{"type":45,"value":341},{"type":40,"tag":139,"props":2538,"children":2539},{"style":248},[2540],{"type":45,"value":346},{"type":40,"tag":139,"props":2542,"children":2543},{"style":254},[2544],{"type":45,"value":351},{"type":40,"tag":139,"props":2546,"children":2547},{"style":248},[2548],{"type":45,"value":356},{"type":40,"tag":139,"props":2550,"children":2551},{"style":254},[2552],{"type":45,"value":361},{"type":40,"tag":139,"props":2554,"children":2555},{"style":248},[2556],{"type":45,"value":356},{"type":40,"tag":139,"props":2558,"children":2559},{"style":254},[2560],{"type":45,"value":370},{"type":40,"tag":139,"props":2562,"children":2563},{"class":141,"line":1237},[2564,2568,2572],{"type":40,"tag":139,"props":2565,"children":2566},{"style":248},[2567],{"type":45,"value":378},{"type":40,"tag":139,"props":2569,"children":2570},{"style":254},[2571],{"type":45,"value":383},{"type":40,"tag":139,"props":2573,"children":2574},{"style":248},[2575],{"type":45,"value":286},{"type":40,"tag":139,"props":2577,"children":2578},{"class":141,"line":1246},[2579],{"type":40,"tag":139,"props":2580,"children":2581},{"emptyLinePlaceholder":177},[2582],{"type":45,"value":180},{"type":40,"tag":139,"props":2584,"children":2585},{"class":141,"line":1296},[2586],{"type":40,"tag":139,"props":2587,"children":2588},{"style":146},[2589],{"type":45,"value":2590},"\u002F\u002F Step 1: Initiate OAuth flow\n",{"type":40,"tag":139,"props":2592,"children":2593},{"class":141,"line":1322},[2594,2599,2603,2607,2611,2615,2620,2624,2628,2633,2638,2644,2648,2653,2657,2662],{"type":40,"tag":139,"props":2595,"children":2596},{"style":254},[2597],{"type":45,"value":2598},"app",{"type":40,"tag":139,"props":2600,"children":2601},{"style":248},[2602],{"type":45,"value":356},{"type":40,"tag":139,"props":2604,"children":2605},{"style":320},[2606],{"type":45,"value":1285},{"type":40,"tag":139,"props":2608,"children":2609},{"style":254},[2610],{"type":45,"value":327},{"type":40,"tag":139,"props":2612,"children":2613},{"style":248},[2614],{"type":45,"value":281},{"type":40,"tag":139,"props":2616,"children":2617},{"style":162},[2618],{"type":45,"value":2619},"\u002Fauth\u002Fstart",{"type":40,"tag":139,"props":2621,"children":2622},{"style":248},[2623],{"type":45,"value":281},{"type":40,"tag":139,"props":2625,"children":2626},{"style":248},[2627],{"type":45,"value":974},{"type":40,"tag":139,"props":2629,"children":2630},{"style":299},[2631],{"type":45,"value":2632}," async",{"type":40,"tag":139,"props":2634,"children":2635},{"style":248},[2636],{"type":45,"value":2637}," (",{"type":40,"tag":139,"props":2639,"children":2641},{"style":2640},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[2642],{"type":45,"value":2643},"req",{"type":40,"tag":139,"props":2645,"children":2646},{"style":248},[2647],{"type":45,"value":974},{"type":40,"tag":139,"props":2649,"children":2650},{"style":2640},[2651],{"type":45,"value":2652}," res",{"type":40,"tag":139,"props":2654,"children":2655},{"style":248},[2656],{"type":45,"value":383},{"type":40,"tag":139,"props":2658,"children":2659},{"style":299},[2660],{"type":45,"value":2661}," =>",{"type":40,"tag":139,"props":2663,"children":2664},{"style":248},[2665],{"type":45,"value":1436},{"type":40,"tag":139,"props":2667,"children":2668},{"class":141,"line":1338},[2669,2674,2678,2683,2687,2691,2695,2699,2703,2707,2711],{"type":40,"tag":139,"props":2670,"children":2671},{"style":299},[2672],{"type":45,"value":2673},"  const",{"type":40,"tag":139,"props":2675,"children":2676},{"style":254},[2677],{"type":45,"value":1778},{"type":40,"tag":139,"props":2679,"children":2680},{"style":248},[2681],{"type":45,"value":2682}," =",{"type":40,"tag":139,"props":2684,"children":2685},{"style":242},[2686],{"type":45,"value":903},{"type":40,"tag":139,"props":2688,"children":2689},{"style":254},[2690],{"type":45,"value":655},{"type":40,"tag":139,"props":2692,"children":2693},{"style":248},[2694],{"type":45,"value":356},{"type":40,"tag":139,"props":2696,"children":2697},{"style":254},[2698],{"type":45,"value":1643},{"type":40,"tag":139,"props":2700,"children":2701},{"style":248},[2702],{"type":45,"value":356},{"type":40,"tag":139,"props":2704,"children":2705},{"style":320},[2706],{"type":45,"value":1598},{"type":40,"tag":139,"props":2708,"children":2709},{"style":338},[2710],{"type":45,"value":327},{"type":40,"tag":139,"props":2712,"children":2713},{"style":248},[2714],{"type":45,"value":332},{"type":40,"tag":139,"props":2716,"children":2717},{"class":141,"line":1346},[2718,2723,2727,2731,2735],{"type":40,"tag":139,"props":2719,"children":2720},{"style":338},[2721],{"type":45,"value":2722},"    callbackUrl",{"type":40,"tag":139,"props":2724,"children":2725},{"style":248},[2726],{"type":45,"value":346},{"type":40,"tag":139,"props":2728,"children":2729},{"style":248},[2730],{"type":45,"value":272},{"type":40,"tag":139,"props":2732,"children":2733},{"style":162},[2734],{"type":45,"value":1680},{"type":40,"tag":139,"props":2736,"children":2737},{"style":248},[2738],{"type":45,"value":727},{"type":40,"tag":139,"props":2740,"children":2741},{"class":141,"line":1355},[2742,2747,2751],{"type":40,"tag":139,"props":2743,"children":2744},{"style":248},[2745],{"type":45,"value":2746},"  }",{"type":40,"tag":139,"props":2748,"children":2749},{"style":338},[2750],{"type":45,"value":383},{"type":40,"tag":139,"props":2752,"children":2753},{"style":248},[2754],{"type":45,"value":286},{"type":40,"tag":139,"props":2756,"children":2757},{"class":141,"line":1393},[2758],{"type":40,"tag":139,"props":2759,"children":2760},{"emptyLinePlaceholder":177},[2761],{"type":45,"value":180},{"type":40,"tag":139,"props":2763,"children":2764},{"class":141,"line":1421},[2765],{"type":40,"tag":139,"props":2766,"children":2767},{"style":146},[2768],{"type":45,"value":2769},"  \u002F\u002F Store any state needed for the callback\n",{"type":40,"tag":139,"props":2771,"children":2772},{"class":141,"line":1439},[2773,2778,2782,2787,2791,2796,2800,2804,2809],{"type":40,"tag":139,"props":2774,"children":2775},{"style":254},[2776],{"type":45,"value":2777},"  req",{"type":40,"tag":139,"props":2779,"children":2780},{"style":248},[2781],{"type":45,"value":356},{"type":40,"tag":139,"props":2783,"children":2784},{"style":254},[2785],{"type":45,"value":2786},"session",{"type":40,"tag":139,"props":2788,"children":2789},{"style":248},[2790],{"type":45,"value":356},{"type":40,"tag":139,"props":2792,"children":2793},{"style":254},[2794],{"type":45,"value":2795},"oauthState",{"type":40,"tag":139,"props":2797,"children":2798},{"style":248},[2799],{"type":45,"value":2682},{"type":40,"tag":139,"props":2801,"children":2802},{"style":248},[2803],{"type":45,"value":251},{"type":40,"tag":139,"props":2805,"children":2806},{"style":146},[2807],{"type":45,"value":2808}," \u002F* ... *\u002F",{"type":40,"tag":139,"props":2810,"children":2811},{"style":248},[2812],{"type":45,"value":2813}," };\n",{"type":40,"tag":139,"props":2815,"children":2816},{"class":141,"line":1465},[2817],{"type":40,"tag":139,"props":2818,"children":2819},{"emptyLinePlaceholder":177},[2820],{"type":45,"value":180},{"type":40,"tag":139,"props":2822,"children":2823},{"class":141,"line":1474},[2824],{"type":40,"tag":139,"props":2825,"children":2826},{"style":146},[2827],{"type":45,"value":2828},"  \u002F\u002F Redirect user to OpenRouter authorization page\n",{"type":40,"tag":139,"props":2830,"children":2831},{"class":141,"line":1490},[2832,2837,2841,2845,2849,2854,2858,2862,2866],{"type":40,"tag":139,"props":2833,"children":2834},{"style":254},[2835],{"type":45,"value":2836},"  res",{"type":40,"tag":139,"props":2838,"children":2839},{"style":248},[2840],{"type":45,"value":356},{"type":40,"tag":139,"props":2842,"children":2843},{"style":320},[2844],{"type":45,"value":1970},{"type":40,"tag":139,"props":2846,"children":2847},{"style":338},[2848],{"type":45,"value":327},{"type":40,"tag":139,"props":2850,"children":2851},{"style":254},[2852],{"type":45,"value":2853},"authResponse",{"type":40,"tag":139,"props":2855,"children":2856},{"style":248},[2857],{"type":45,"value":356},{"type":40,"tag":139,"props":2859,"children":2860},{"style":254},[2861],{"type":45,"value":1934},{"type":40,"tag":139,"props":2863,"children":2864},{"style":338},[2865],{"type":45,"value":383},{"type":40,"tag":139,"props":2867,"children":2868},{"style":248},[2869],{"type":45,"value":286},{"type":40,"tag":139,"props":2871,"children":2872},{"class":141,"line":1498},[2873,2877,2881],{"type":40,"tag":139,"props":2874,"children":2875},{"style":248},[2876],{"type":45,"value":378},{"type":40,"tag":139,"props":2878,"children":2879},{"style":254},[2880],{"type":45,"value":383},{"type":40,"tag":139,"props":2882,"children":2883},{"style":248},[2884],{"type":45,"value":286},{"type":40,"tag":139,"props":2886,"children":2887},{"class":141,"line":1507},[2888],{"type":40,"tag":139,"props":2889,"children":2890},{"emptyLinePlaceholder":177},[2891],{"type":45,"value":180},{"type":40,"tag":139,"props":2893,"children":2894},{"class":141,"line":1544},[2895],{"type":40,"tag":139,"props":2896,"children":2897},{"style":146},[2898],{"type":45,"value":2899},"\u002F\u002F Step 2: Handle callback and exchange code\n",{"type":40,"tag":139,"props":2901,"children":2902},{"class":141,"line":1568},[2903,2907,2911,2915,2919,2923,2928,2932,2936,2940,2944,2948,2952,2956,2960,2964],{"type":40,"tag":139,"props":2904,"children":2905},{"style":254},[2906],{"type":45,"value":2598},{"type":40,"tag":139,"props":2908,"children":2909},{"style":248},[2910],{"type":45,"value":356},{"type":40,"tag":139,"props":2912,"children":2913},{"style":320},[2914],{"type":45,"value":1285},{"type":40,"tag":139,"props":2916,"children":2917},{"style":254},[2918],{"type":45,"value":327},{"type":40,"tag":139,"props":2920,"children":2921},{"style":248},[2922],{"type":45,"value":281},{"type":40,"tag":139,"props":2924,"children":2925},{"style":162},[2926],{"type":45,"value":2927},"\u002Fauth\u002Fcallback",{"type":40,"tag":139,"props":2929,"children":2930},{"style":248},[2931],{"type":45,"value":281},{"type":40,"tag":139,"props":2933,"children":2934},{"style":248},[2935],{"type":45,"value":974},{"type":40,"tag":139,"props":2937,"children":2938},{"style":299},[2939],{"type":45,"value":2632},{"type":40,"tag":139,"props":2941,"children":2942},{"style":248},[2943],{"type":45,"value":2637},{"type":40,"tag":139,"props":2945,"children":2946},{"style":2640},[2947],{"type":45,"value":2643},{"type":40,"tag":139,"props":2949,"children":2950},{"style":248},[2951],{"type":45,"value":974},{"type":40,"tag":139,"props":2953,"children":2954},{"style":2640},[2955],{"type":45,"value":2652},{"type":40,"tag":139,"props":2957,"children":2958},{"style":248},[2959],{"type":45,"value":383},{"type":40,"tag":139,"props":2961,"children":2962},{"style":299},[2963],{"type":45,"value":2661},{"type":40,"tag":139,"props":2965,"children":2966},{"style":248},[2967],{"type":45,"value":1436},{"type":40,"tag":139,"props":2969,"children":2970},{"class":141,"line":27},[2971,2975,2979,2984,2988,2992,2996,3000,3004],{"type":40,"tag":139,"props":2972,"children":2973},{"style":299},[2974],{"type":45,"value":2673},{"type":40,"tag":139,"props":2976,"children":2977},{"style":248},[2978],{"type":45,"value":251},{"type":40,"tag":139,"props":2980,"children":2981},{"style":254},[2982],{"type":45,"value":2983}," code",{"type":40,"tag":139,"props":2985,"children":2986},{"style":248},[2987],{"type":45,"value":262},{"type":40,"tag":139,"props":2989,"children":2990},{"style":248},[2991],{"type":45,"value":2682},{"type":40,"tag":139,"props":2993,"children":2994},{"style":254},[2995],{"type":45,"value":2034},{"type":40,"tag":139,"props":2997,"children":2998},{"style":248},[2999],{"type":45,"value":356},{"type":40,"tag":139,"props":3001,"children":3002},{"style":254},[3003],{"type":45,"value":2043},{"type":40,"tag":139,"props":3005,"children":3006},{"style":248},[3007],{"type":45,"value":286},{"type":40,"tag":139,"props":3009,"children":3011},{"class":141,"line":3010},27,[3012],{"type":40,"tag":139,"props":3013,"children":3014},{"emptyLinePlaceholder":177},[3015],{"type":45,"value":180},{"type":40,"tag":139,"props":3017,"children":3019},{"class":141,"line":3018},28,[3020,3025,3029,3034,3038,3043],{"type":40,"tag":139,"props":3021,"children":3022},{"style":242},[3023],{"type":45,"value":3024},"  if",{"type":40,"tag":139,"props":3026,"children":3027},{"style":338},[3028],{"type":45,"value":2637},{"type":40,"tag":139,"props":3030,"children":3031},{"style":248},[3032],{"type":45,"value":3033},"!",{"type":40,"tag":139,"props":3035,"children":3036},{"style":254},[3037],{"type":45,"value":54},{"type":40,"tag":139,"props":3039,"children":3040},{"style":338},[3041],{"type":45,"value":3042},") ",{"type":40,"tag":139,"props":3044,"children":3045},{"style":248},[3046],{"type":45,"value":332},{"type":40,"tag":139,"props":3048,"children":3050},{"class":141,"line":3049},29,[3051,3056,3060,3064,3069,3073,3079,3083,3087,3092,3096,3100,3105,3109,3113],{"type":40,"tag":139,"props":3052,"children":3053},{"style":242},[3054],{"type":45,"value":3055},"    return",{"type":40,"tag":139,"props":3057,"children":3058},{"style":254},[3059],{"type":45,"value":2652},{"type":40,"tag":139,"props":3061,"children":3062},{"style":248},[3063],{"type":45,"value":356},{"type":40,"tag":139,"props":3065,"children":3066},{"style":320},[3067],{"type":45,"value":3068},"status",{"type":40,"tag":139,"props":3070,"children":3071},{"style":338},[3072],{"type":45,"value":327},{"type":40,"tag":139,"props":3074,"children":3076},{"style":3075},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[3077],{"type":45,"value":3078},"400",{"type":40,"tag":139,"props":3080,"children":3081},{"style":338},[3082],{"type":45,"value":383},{"type":40,"tag":139,"props":3084,"children":3085},{"style":248},[3086],{"type":45,"value":356},{"type":40,"tag":139,"props":3088,"children":3089},{"style":320},[3090],{"type":45,"value":3091},"send",{"type":40,"tag":139,"props":3093,"children":3094},{"style":338},[3095],{"type":45,"value":327},{"type":40,"tag":139,"props":3097,"children":3098},{"style":248},[3099],{"type":45,"value":281},{"type":40,"tag":139,"props":3101,"children":3102},{"style":162},[3103],{"type":45,"value":3104},"Authorization code missing",{"type":40,"tag":139,"props":3106,"children":3107},{"style":248},[3108],{"type":45,"value":281},{"type":40,"tag":139,"props":3110,"children":3111},{"style":338},[3112],{"type":45,"value":383},{"type":40,"tag":139,"props":3114,"children":3115},{"style":248},[3116],{"type":45,"value":286},{"type":40,"tag":139,"props":3118,"children":3120},{"class":141,"line":3119},30,[3121],{"type":40,"tag":139,"props":3122,"children":3123},{"style":248},[3124],{"type":45,"value":1471},{"type":40,"tag":139,"props":3126,"children":3128},{"class":141,"line":3127},31,[3129],{"type":40,"tag":139,"props":3130,"children":3131},{"emptyLinePlaceholder":177},[3132],{"type":45,"value":180},{"type":40,"tag":139,"props":3134,"children":3136},{"class":141,"line":3135},32,[3137,3142],{"type":40,"tag":139,"props":3138,"children":3139},{"style":242},[3140],{"type":45,"value":3141},"  try",{"type":40,"tag":139,"props":3143,"children":3144},{"style":248},[3145],{"type":45,"value":1436},{"type":40,"tag":139,"props":3147,"children":3149},{"class":141,"line":3148},33,[3150,3155,3159,3163,3167,3171,3175,3179,3183,3187,3191],{"type":40,"tag":139,"props":3151,"children":3152},{"style":299},[3153],{"type":45,"value":3154},"    const",{"type":40,"tag":139,"props":3156,"children":3157},{"style":254},[3158],{"type":45,"value":2207},{"type":40,"tag":139,"props":3160,"children":3161},{"style":248},[3162],{"type":45,"value":2682},{"type":40,"tag":139,"props":3164,"children":3165},{"style":242},[3166],{"type":45,"value":903},{"type":40,"tag":139,"props":3168,"children":3169},{"style":254},[3170],{"type":45,"value":655},{"type":40,"tag":139,"props":3172,"children":3173},{"style":248},[3174],{"type":45,"value":356},{"type":40,"tag":139,"props":3176,"children":3177},{"style":254},[3178],{"type":45,"value":1643},{"type":40,"tag":139,"props":3180,"children":3181},{"style":248},[3182],{"type":45,"value":356},{"type":40,"tag":139,"props":3184,"children":3185},{"style":320},[3186],{"type":45,"value":1993},{"type":40,"tag":139,"props":3188,"children":3189},{"style":338},[3190],{"type":45,"value":327},{"type":40,"tag":139,"props":3192,"children":3193},{"style":248},[3194],{"type":45,"value":332},{"type":40,"tag":139,"props":3196,"children":3198},{"class":141,"line":3197},34,[3199,3204,3208,3212,3216],{"type":40,"tag":139,"props":3200,"children":3201},{"style":338},[3202],{"type":45,"value":3203},"      code",{"type":40,"tag":139,"props":3205,"children":3206},{"style":248},[3207],{"type":45,"value":346},{"type":40,"tag":139,"props":3209,"children":3210},{"style":254},[3211],{"type":45,"value":2983},{"type":40,"tag":139,"props":3213,"children":3214},{"style":242},[3215],{"type":45,"value":2392},{"type":40,"tag":139,"props":3217,"children":3218},{"style":156},[3219],{"type":45,"value":3220}," string\n",{"type":40,"tag":139,"props":3222,"children":3224},{"class":141,"line":3223},35,[3225,3230,3234],{"type":40,"tag":139,"props":3226,"children":3227},{"style":248},[3228],{"type":45,"value":3229},"    }",{"type":40,"tag":139,"props":3231,"children":3232},{"style":338},[3233],{"type":45,"value":383},{"type":40,"tag":139,"props":3235,"children":3236},{"style":248},[3237],{"type":45,"value":286},{"type":40,"tag":139,"props":3239,"children":3241},{"class":141,"line":3240},36,[3242],{"type":40,"tag":139,"props":3243,"children":3244},{"emptyLinePlaceholder":177},[3245],{"type":45,"value":180},{"type":40,"tag":139,"props":3247,"children":3249},{"class":141,"line":3248},37,[3250],{"type":40,"tag":139,"props":3251,"children":3252},{"style":146},[3253],{"type":45,"value":3254},"    \u002F\u002F Store the user's API key securely\n",{"type":40,"tag":139,"props":3256,"children":3258},{"class":141,"line":3257},38,[3259,3264,3268,3272,3276,3280,3284,3288,3293,3297,3301,3305,3309,3313],{"type":40,"tag":139,"props":3260,"children":3261},{"style":242},[3262],{"type":45,"value":3263},"    await",{"type":40,"tag":139,"props":3265,"children":3266},{"style":320},[3267],{"type":45,"value":2247},{"type":40,"tag":139,"props":3269,"children":3270},{"style":338},[3271],{"type":45,"value":327},{"type":40,"tag":139,"props":3273,"children":3274},{"style":254},[3275],{"type":45,"value":2643},{"type":40,"tag":139,"props":3277,"children":3278},{"style":248},[3279],{"type":45,"value":356},{"type":40,"tag":139,"props":3281,"children":3282},{"style":254},[3283],{"type":45,"value":2786},{"type":40,"tag":139,"props":3285,"children":3286},{"style":248},[3287],{"type":45,"value":356},{"type":40,"tag":139,"props":3289,"children":3290},{"style":254},[3291],{"type":45,"value":3292},"userId",{"type":40,"tag":139,"props":3294,"children":3295},{"style":248},[3296],{"type":45,"value":974},{"type":40,"tag":139,"props":3298,"children":3299},{"style":254},[3300],{"type":45,"value":2207},{"type":40,"tag":139,"props":3302,"children":3303},{"style":248},[3304],{"type":45,"value":356},{"type":40,"tag":139,"props":3306,"children":3307},{"style":254},[3308],{"type":45,"value":2216},{"type":40,"tag":139,"props":3310,"children":3311},{"style":338},[3312],{"type":45,"value":383},{"type":40,"tag":139,"props":3314,"children":3315},{"style":248},[3316],{"type":45,"value":286},{"type":40,"tag":139,"props":3318,"children":3320},{"class":141,"line":3319},39,[3321],{"type":40,"tag":139,"props":3322,"children":3323},{"emptyLinePlaceholder":177},[3324],{"type":45,"value":180},{"type":40,"tag":139,"props":3326,"children":3328},{"class":141,"line":3327},40,[3329,3334,3338,3342,3346,3350,3355,3359,3363],{"type":40,"tag":139,"props":3330,"children":3331},{"style":254},[3332],{"type":45,"value":3333},"    res",{"type":40,"tag":139,"props":3335,"children":3336},{"style":248},[3337],{"type":45,"value":356},{"type":40,"tag":139,"props":3339,"children":3340},{"style":320},[3341],{"type":45,"value":1970},{"type":40,"tag":139,"props":3343,"children":3344},{"style":338},[3345],{"type":45,"value":327},{"type":40,"tag":139,"props":3347,"children":3348},{"style":248},[3349],{"type":45,"value":281},{"type":40,"tag":139,"props":3351,"children":3352},{"style":162},[3353],{"type":45,"value":3354},"\u002Fdashboard?auth=success",{"type":40,"tag":139,"props":3356,"children":3357},{"style":248},[3358],{"type":45,"value":281},{"type":40,"tag":139,"props":3360,"children":3361},{"style":338},[3362],{"type":45,"value":383},{"type":40,"tag":139,"props":3364,"children":3365},{"style":248},[3366],{"type":45,"value":286},{"type":40,"tag":139,"props":3368,"children":3370},{"class":141,"line":3369},41,[3371,3375,3380,3384,3389,3393],{"type":40,"tag":139,"props":3372,"children":3373},{"style":248},[3374],{"type":45,"value":2746},{"type":40,"tag":139,"props":3376,"children":3377},{"style":242},[3378],{"type":45,"value":3379}," catch",{"type":40,"tag":139,"props":3381,"children":3382},{"style":338},[3383],{"type":45,"value":2637},{"type":40,"tag":139,"props":3385,"children":3386},{"style":254},[3387],{"type":45,"value":3388},"error",{"type":40,"tag":139,"props":3390,"children":3391},{"style":338},[3392],{"type":45,"value":3042},{"type":40,"tag":139,"props":3394,"children":3395},{"style":248},[3396],{"type":45,"value":332},{"type":40,"tag":139,"props":3398,"children":3400},{"class":141,"line":3399},42,[3401,3406,3410,3414,3418,3422,3427,3431,3435,3440,3444],{"type":40,"tag":139,"props":3402,"children":3403},{"style":254},[3404],{"type":45,"value":3405},"    console",{"type":40,"tag":139,"props":3407,"children":3408},{"style":248},[3409],{"type":45,"value":356},{"type":40,"tag":139,"props":3411,"children":3412},{"style":320},[3413],{"type":45,"value":3388},{"type":40,"tag":139,"props":3415,"children":3416},{"style":338},[3417],{"type":45,"value":327},{"type":40,"tag":139,"props":3419,"children":3420},{"style":248},[3421],{"type":45,"value":281},{"type":40,"tag":139,"props":3423,"children":3424},{"style":162},[3425],{"type":45,"value":3426},"OAuth exchange failed:",{"type":40,"tag":139,"props":3428,"children":3429},{"style":248},[3430],{"type":45,"value":281},{"type":40,"tag":139,"props":3432,"children":3433},{"style":248},[3434],{"type":45,"value":974},{"type":40,"tag":139,"props":3436,"children":3437},{"style":254},[3438],{"type":45,"value":3439}," error",{"type":40,"tag":139,"props":3441,"children":3442},{"style":338},[3443],{"type":45,"value":383},{"type":40,"tag":139,"props":3445,"children":3446},{"style":248},[3447],{"type":45,"value":286},{"type":40,"tag":139,"props":3449,"children":3451},{"class":141,"line":3450},43,[3452,3456,3460,3464,3468,3472,3477,3481,3485],{"type":40,"tag":139,"props":3453,"children":3454},{"style":254},[3455],{"type":45,"value":3333},{"type":40,"tag":139,"props":3457,"children":3458},{"style":248},[3459],{"type":45,"value":356},{"type":40,"tag":139,"props":3461,"children":3462},{"style":320},[3463],{"type":45,"value":1970},{"type":40,"tag":139,"props":3465,"children":3466},{"style":338},[3467],{"type":45,"value":327},{"type":40,"tag":139,"props":3469,"children":3470},{"style":248},[3471],{"type":45,"value":281},{"type":40,"tag":139,"props":3473,"children":3474},{"style":162},[3475],{"type":45,"value":3476},"\u002Fauth\u002Ferror",{"type":40,"tag":139,"props":3478,"children":3479},{"style":248},[3480],{"type":45,"value":281},{"type":40,"tag":139,"props":3482,"children":3483},{"style":338},[3484],{"type":45,"value":383},{"type":40,"tag":139,"props":3486,"children":3487},{"style":248},[3488],{"type":45,"value":286},{"type":40,"tag":139,"props":3490,"children":3492},{"class":141,"line":3491},44,[3493],{"type":40,"tag":139,"props":3494,"children":3495},{"style":248},[3496],{"type":45,"value":1471},{"type":40,"tag":139,"props":3498,"children":3500},{"class":141,"line":3499},45,[3501,3505,3509],{"type":40,"tag":139,"props":3502,"children":3503},{"style":248},[3504],{"type":45,"value":378},{"type":40,"tag":139,"props":3506,"children":3507},{"style":254},[3508],{"type":45,"value":383},{"type":40,"tag":139,"props":3510,"children":3511},{"style":248},[3512],{"type":45,"value":286},{"type":40,"tag":139,"props":3514,"children":3516},{"class":141,"line":3515},46,[3517],{"type":40,"tag":139,"props":3518,"children":3519},{"emptyLinePlaceholder":177},[3520],{"type":45,"value":180},{"type":40,"tag":139,"props":3522,"children":3524},{"class":141,"line":3523},47,[3525],{"type":40,"tag":139,"props":3526,"children":3527},{"style":146},[3528],{"type":45,"value":3529},"\u002F\u002F Step 3: Use the user's API key for their requests\n",{"type":40,"tag":139,"props":3531,"children":3533},{"class":141,"line":3532},48,[3534,3538,3542,3547,3551,3555,3560,3564,3568,3572,3576,3580,3584,3588,3592,3596],{"type":40,"tag":139,"props":3535,"children":3536},{"style":254},[3537],{"type":45,"value":2598},{"type":40,"tag":139,"props":3539,"children":3540},{"style":248},[3541],{"type":45,"value":356},{"type":40,"tag":139,"props":3543,"children":3544},{"style":320},[3545],{"type":45,"value":3546},"post",{"type":40,"tag":139,"props":3548,"children":3549},{"style":254},[3550],{"type":45,"value":327},{"type":40,"tag":139,"props":3552,"children":3553},{"style":248},[3554],{"type":45,"value":281},{"type":40,"tag":139,"props":3556,"children":3557},{"style":162},[3558],{"type":45,"value":3559},"\u002Fapi\u002Fchat",{"type":40,"tag":139,"props":3561,"children":3562},{"style":248},[3563],{"type":45,"value":281},{"type":40,"tag":139,"props":3565,"children":3566},{"style":248},[3567],{"type":45,"value":974},{"type":40,"tag":139,"props":3569,"children":3570},{"style":299},[3571],{"type":45,"value":2632},{"type":40,"tag":139,"props":3573,"children":3574},{"style":248},[3575],{"type":45,"value":2637},{"type":40,"tag":139,"props":3577,"children":3578},{"style":2640},[3579],{"type":45,"value":2643},{"type":40,"tag":139,"props":3581,"children":3582},{"style":248},[3583],{"type":45,"value":974},{"type":40,"tag":139,"props":3585,"children":3586},{"style":2640},[3587],{"type":45,"value":2652},{"type":40,"tag":139,"props":3589,"children":3590},{"style":248},[3591],{"type":45,"value":383},{"type":40,"tag":139,"props":3593,"children":3594},{"style":299},[3595],{"type":45,"value":2661},{"type":40,"tag":139,"props":3597,"children":3598},{"style":248},[3599],{"type":45,"value":1436},{"type":40,"tag":139,"props":3601,"children":3603},{"class":141,"line":3602},49,[3604,3608,3613,3617,3621,3626,3630,3634,3638,3642,3646,3650,3654],{"type":40,"tag":139,"props":3605,"children":3606},{"style":299},[3607],{"type":45,"value":2673},{"type":40,"tag":139,"props":3609,"children":3610},{"style":254},[3611],{"type":45,"value":3612}," userApiKey",{"type":40,"tag":139,"props":3614,"children":3615},{"style":248},[3616],{"type":45,"value":2682},{"type":40,"tag":139,"props":3618,"children":3619},{"style":242},[3620],{"type":45,"value":903},{"type":40,"tag":139,"props":3622,"children":3623},{"style":320},[3624],{"type":45,"value":3625}," getUserApiKey",{"type":40,"tag":139,"props":3627,"children":3628},{"style":338},[3629],{"type":45,"value":327},{"type":40,"tag":139,"props":3631,"children":3632},{"style":254},[3633],{"type":45,"value":2643},{"type":40,"tag":139,"props":3635,"children":3636},{"style":248},[3637],{"type":45,"value":356},{"type":40,"tag":139,"props":3639,"children":3640},{"style":254},[3641],{"type":45,"value":2786},{"type":40,"tag":139,"props":3643,"children":3644},{"style":248},[3645],{"type":45,"value":356},{"type":40,"tag":139,"props":3647,"children":3648},{"style":254},[3649],{"type":45,"value":3292},{"type":40,"tag":139,"props":3651,"children":3652},{"style":338},[3653],{"type":45,"value":383},{"type":40,"tag":139,"props":3655,"children":3656},{"style":248},[3657],{"type":45,"value":286},{"type":40,"tag":139,"props":3659,"children":3661},{"class":141,"line":3660},50,[3662],{"type":40,"tag":139,"props":3663,"children":3664},{"emptyLinePlaceholder":177},[3665],{"type":45,"value":180},{"type":40,"tag":139,"props":3667,"children":3669},{"class":141,"line":3668},51,[3670],{"type":40,"tag":139,"props":3671,"children":3672},{"style":146},[3673],{"type":45,"value":3674},"  \u002F\u002F Create an agent client with the user's key\n",{"type":40,"tag":139,"props":3676,"children":3678},{"class":141,"line":3677},52,[3679,3683,3688,3692,3696,3700,3704],{"type":40,"tag":139,"props":3680,"children":3681},{"style":299},[3682],{"type":45,"value":2673},{"type":40,"tag":139,"props":3684,"children":3685},{"style":254},[3686],{"type":45,"value":3687}," userAgent",{"type":40,"tag":139,"props":3689,"children":3690},{"style":248},[3691],{"type":45,"value":2682},{"type":40,"tag":139,"props":3693,"children":3694},{"style":248},[3695],{"type":45,"value":317},{"type":40,"tag":139,"props":3697,"children":3698},{"style":320},[3699],{"type":45,"value":2397},{"type":40,"tag":139,"props":3701,"children":3702},{"style":338},[3703],{"type":45,"value":327},{"type":40,"tag":139,"props":3705,"children":3706},{"style":248},[3707],{"type":45,"value":332},{"type":40,"tag":139,"props":3709,"children":3711},{"class":141,"line":3710},53,[3712,3717,3721],{"type":40,"tag":139,"props":3713,"children":3714},{"style":338},[3715],{"type":45,"value":3716},"    apiKey",{"type":40,"tag":139,"props":3718,"children":3719},{"style":248},[3720],{"type":45,"value":346},{"type":40,"tag":139,"props":3722,"children":3723},{"style":254},[3724],{"type":45,"value":3725}," userApiKey\n",{"type":40,"tag":139,"props":3727,"children":3729},{"class":141,"line":3728},54,[3730,3734,3738],{"type":40,"tag":139,"props":3731,"children":3732},{"style":248},[3733],{"type":45,"value":2746},{"type":40,"tag":139,"props":3735,"children":3736},{"style":338},[3737],{"type":45,"value":383},{"type":40,"tag":139,"props":3739,"children":3740},{"style":248},[3741],{"type":45,"value":286},{"type":40,"tag":139,"props":3743,"children":3745},{"class":141,"line":3744},55,[3746],{"type":40,"tag":139,"props":3747,"children":3748},{"emptyLinePlaceholder":177},[3749],{"type":45,"value":180},{"type":40,"tag":139,"props":3751,"children":3753},{"class":141,"line":3752},56,[3754,3758,3763,3767,3771,3775,3779,3783],{"type":40,"tag":139,"props":3755,"children":3756},{"style":299},[3757],{"type":45,"value":2673},{"type":40,"tag":139,"props":3759,"children":3760},{"style":254},[3761],{"type":45,"value":3762}," result",{"type":40,"tag":139,"props":3764,"children":3765},{"style":248},[3766],{"type":45,"value":2682},{"type":40,"tag":139,"props":3768,"children":3769},{"style":254},[3770],{"type":45,"value":3687},{"type":40,"tag":139,"props":3772,"children":3773},{"style":248},[3774],{"type":45,"value":356},{"type":40,"tag":139,"props":3776,"children":3777},{"style":320},[3778],{"type":45,"value":59},{"type":40,"tag":139,"props":3780,"children":3781},{"style":338},[3782],{"type":45,"value":327},{"type":40,"tag":139,"props":3784,"children":3785},{"style":248},[3786],{"type":45,"value":332},{"type":40,"tag":139,"props":3788,"children":3790},{"class":141,"line":3789},57,[3791,3796,3800,3804,3808,3812],{"type":40,"tag":139,"props":3792,"children":3793},{"style":338},[3794],{"type":45,"value":3795},"    model",{"type":40,"tag":139,"props":3797,"children":3798},{"style":248},[3799],{"type":45,"value":346},{"type":40,"tag":139,"props":3801,"children":3802},{"style":248},[3803],{"type":45,"value":272},{"type":40,"tag":139,"props":3805,"children":3806},{"style":162},[3807],{"type":45,"value":692},{"type":40,"tag":139,"props":3809,"children":3810},{"style":248},[3811],{"type":45,"value":281},{"type":40,"tag":139,"props":3813,"children":3814},{"style":248},[3815],{"type":45,"value":701},{"type":40,"tag":139,"props":3817,"children":3819},{"class":141,"line":3818},58,[3820,3825,3829,3833,3837,3842,3846],{"type":40,"tag":139,"props":3821,"children":3822},{"style":338},[3823],{"type":45,"value":3824},"    input",{"type":40,"tag":139,"props":3826,"children":3827},{"style":248},[3828],{"type":45,"value":346},{"type":40,"tag":139,"props":3830,"children":3831},{"style":254},[3832],{"type":45,"value":2034},{"type":40,"tag":139,"props":3834,"children":3835},{"style":248},[3836],{"type":45,"value":356},{"type":40,"tag":139,"props":3838,"children":3839},{"style":254},[3840],{"type":45,"value":3841},"body",{"type":40,"tag":139,"props":3843,"children":3844},{"style":248},[3845],{"type":45,"value":356},{"type":40,"tag":139,"props":3847,"children":3848},{"style":254},[3849],{"type":45,"value":3850},"message\n",{"type":40,"tag":139,"props":3852,"children":3854},{"class":141,"line":3853},59,[3855,3859,3863],{"type":40,"tag":139,"props":3856,"children":3857},{"style":248},[3858],{"type":45,"value":2746},{"type":40,"tag":139,"props":3860,"children":3861},{"style":338},[3862],{"type":45,"value":383},{"type":40,"tag":139,"props":3864,"children":3865},{"style":248},[3866],{"type":45,"value":286},{"type":40,"tag":139,"props":3868,"children":3870},{"class":141,"line":3869},60,[3871],{"type":40,"tag":139,"props":3872,"children":3873},{"emptyLinePlaceholder":177},[3874],{"type":45,"value":180},{"type":40,"tag":139,"props":3876,"children":3878},{"class":141,"line":3877},61,[3879,3883,3888,3892,3896,3900,3904,3909,3913],{"type":40,"tag":139,"props":3880,"children":3881},{"style":299},[3882],{"type":45,"value":2673},{"type":40,"tag":139,"props":3884,"children":3885},{"style":254},[3886],{"type":45,"value":3887}," text",{"type":40,"tag":139,"props":3889,"children":3890},{"style":248},[3891],{"type":45,"value":2682},{"type":40,"tag":139,"props":3893,"children":3894},{"style":242},[3895],{"type":45,"value":903},{"type":40,"tag":139,"props":3897,"children":3898},{"style":254},[3899],{"type":45,"value":3762},{"type":40,"tag":139,"props":3901,"children":3902},{"style":248},[3903],{"type":45,"value":356},{"type":40,"tag":139,"props":3905,"children":3906},{"style":320},[3907],{"type":45,"value":3908},"getText",{"type":40,"tag":139,"props":3910,"children":3911},{"style":338},[3912],{"type":45,"value":931},{"type":40,"tag":139,"props":3914,"children":3915},{"style":248},[3916],{"type":45,"value":286},{"type":40,"tag":139,"props":3918,"children":3920},{"class":141,"line":3919},62,[3921,3925,3929,3934,3938,3942,3947,3951,3955,3959,3963],{"type":40,"tag":139,"props":3922,"children":3923},{"style":254},[3924],{"type":45,"value":2836},{"type":40,"tag":139,"props":3926,"children":3927},{"style":248},[3928],{"type":45,"value":356},{"type":40,"tag":139,"props":3930,"children":3931},{"style":320},[3932],{"type":45,"value":3933},"json",{"type":40,"tag":139,"props":3935,"children":3936},{"style":338},[3937],{"type":45,"value":327},{"type":40,"tag":139,"props":3939,"children":3940},{"style":248},[3941],{"type":45,"value":833},{"type":40,"tag":139,"props":3943,"children":3944},{"style":338},[3945],{"type":45,"value":3946}," response",{"type":40,"tag":139,"props":3948,"children":3949},{"style":248},[3950],{"type":45,"value":346},{"type":40,"tag":139,"props":3952,"children":3953},{"style":254},[3954],{"type":45,"value":3887},{"type":40,"tag":139,"props":3956,"children":3957},{"style":248},[3958],{"type":45,"value":262},{"type":40,"tag":139,"props":3960,"children":3961},{"style":338},[3962],{"type":45,"value":383},{"type":40,"tag":139,"props":3964,"children":3965},{"style":248},[3966],{"type":45,"value":286},{"type":40,"tag":139,"props":3968,"children":3970},{"class":141,"line":3969},63,[3971,3975,3979],{"type":40,"tag":139,"props":3972,"children":3973},{"style":248},[3974],{"type":45,"value":378},{"type":40,"tag":139,"props":3976,"children":3977},{"style":254},[3978],{"type":45,"value":383},{"type":40,"tag":139,"props":3980,"children":3981},{"style":248},[3982],{"type":45,"value":286},{"type":40,"tag":403,"props":3984,"children":3986},{"id":3985},"security-best-practices",[3987],{"type":45,"value":3988},"Security Best Practices",{"type":40,"tag":422,"props":3990,"children":3991},{},[3992,4002,4012,4022,4032,4042],{"type":40,"tag":72,"props":3993,"children":3994},{},[3995,4000],{"type":40,"tag":76,"props":3996,"children":3997},{},[3998],{"type":45,"value":3999},"Environment Variables",{"type":45,"value":4001},": Store API keys in environment variables, never in code",{"type":40,"tag":72,"props":4003,"children":4004},{},[4005,4010],{"type":40,"tag":76,"props":4006,"children":4007},{},[4008],{"type":45,"value":4009},"Key Rotation",{"type":45,"value":4011},": Rotate keys periodically using the key management API",{"type":40,"tag":72,"props":4013,"children":4014},{},[4015,4020],{"type":40,"tag":76,"props":4016,"children":4017},{},[4018],{"type":45,"value":4019},"Environment Separation",{"type":45,"value":4021},": Use different keys for development, staging, and production",{"type":40,"tag":72,"props":4023,"children":4024},{},[4025,4030],{"type":40,"tag":76,"props":4026,"children":4027},{},[4028],{"type":45,"value":4029},"OAuth for Users",{"type":45,"value":4031},": Use the OAuth PKCE flow for user-facing apps to avoid handling user credentials",{"type":40,"tag":72,"props":4033,"children":4034},{},[4035,4040],{"type":40,"tag":76,"props":4036,"children":4037},{},[4038],{"type":45,"value":4039},"Secure Storage",{"type":45,"value":4041},": Store user API keys encrypted in your database",{"type":40,"tag":72,"props":4043,"children":4044},{},[4045,4050],{"type":40,"tag":76,"props":4046,"children":4047},{},[4048],{"type":45,"value":4049},"Minimal Scope",{"type":45,"value":4051},": Create keys with only the permissions needed",{"type":40,"tag":117,"props":4053,"children":4054},{},[],{"type":40,"tag":121,"props":4056,"children":4058},{"id":4057},"core-concepts-callmodel",[4059],{"type":45,"value":4060},"Core Concepts: callModel",{"type":40,"tag":48,"props":4062,"children":4063},{},[4064,4066,4071],{"type":45,"value":4065},"The ",{"type":40,"tag":54,"props":4067,"children":4069},{"className":4068},[],[4070],{"type":45,"value":59},{"type":45,"value":4072}," function is the primary interface for text generation. It provides a unified, type-safe way to interact with any supported model.",{"type":40,"tag":403,"props":4074,"children":4076},{"id":4075},"basic-usage",[4077],{"type":45,"value":4078},"Basic Usage",{"type":40,"tag":128,"props":4080,"children":4082},{"className":231,"code":4081,"language":19,"meta":133,"style":133},"const result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Explain quantum computing in one sentence.',\n});\n\nconst text = await result.getText();\n",[4083],{"type":40,"tag":54,"props":4084,"children":4085},{"__ignoreMap":133},[4086,4121,4148,4176,4191,4198],{"type":40,"tag":139,"props":4087,"children":4088},{"class":141,"line":142},[4089,4093,4097,4101,4105,4109,4113,4117],{"type":40,"tag":139,"props":4090,"children":4091},{"style":299},[4092],{"type":45,"value":302},{"type":40,"tag":139,"props":4094,"children":4095},{"style":254},[4096],{"type":45,"value":646},{"type":40,"tag":139,"props":4098,"children":4099},{"style":248},[4100],{"type":45,"value":312},{"type":40,"tag":139,"props":4102,"children":4103},{"style":254},[4104],{"type":45,"value":655},{"type":40,"tag":139,"props":4106,"children":4107},{"style":248},[4108],{"type":45,"value":356},{"type":40,"tag":139,"props":4110,"children":4111},{"style":320},[4112],{"type":45,"value":59},{"type":40,"tag":139,"props":4114,"children":4115},{"style":254},[4116],{"type":45,"value":327},{"type":40,"tag":139,"props":4118,"children":4119},{"style":248},[4120],{"type":45,"value":332},{"type":40,"tag":139,"props":4122,"children":4123},{"class":141,"line":152},[4124,4128,4132,4136,4140,4144],{"type":40,"tag":139,"props":4125,"children":4126},{"style":338},[4127],{"type":45,"value":679},{"type":40,"tag":139,"props":4129,"children":4130},{"style":248},[4131],{"type":45,"value":346},{"type":40,"tag":139,"props":4133,"children":4134},{"style":248},[4135],{"type":45,"value":272},{"type":40,"tag":139,"props":4137,"children":4138},{"style":162},[4139],{"type":45,"value":692},{"type":40,"tag":139,"props":4141,"children":4142},{"style":248},[4143],{"type":45,"value":281},{"type":40,"tag":139,"props":4145,"children":4146},{"style":248},[4147],{"type":45,"value":701},{"type":40,"tag":139,"props":4149,"children":4150},{"class":141,"line":173},[4151,4155,4159,4163,4168,4172],{"type":40,"tag":139,"props":4152,"children":4153},{"style":338},[4154],{"type":45,"value":709},{"type":40,"tag":139,"props":4156,"children":4157},{"style":248},[4158],{"type":45,"value":346},{"type":40,"tag":139,"props":4160,"children":4161},{"style":248},[4162],{"type":45,"value":272},{"type":40,"tag":139,"props":4164,"children":4165},{"style":162},[4166],{"type":45,"value":4167},"Explain quantum computing in one sentence.",{"type":40,"tag":139,"props":4169,"children":4170},{"style":248},[4171],{"type":45,"value":281},{"type":40,"tag":139,"props":4173,"children":4174},{"style":248},[4175],{"type":45,"value":701},{"type":40,"tag":139,"props":4177,"children":4178},{"class":141,"line":183},[4179,4183,4187],{"type":40,"tag":139,"props":4180,"children":4181},{"style":248},[4182],{"type":45,"value":378},{"type":40,"tag":139,"props":4184,"children":4185},{"style":254},[4186],{"type":45,"value":383},{"type":40,"tag":139,"props":4188,"children":4189},{"style":248},[4190],{"type":45,"value":286},{"type":40,"tag":139,"props":4192,"children":4193},{"class":141,"line":192},[4194],{"type":40,"tag":139,"props":4195,"children":4196},{"emptyLinePlaceholder":177},[4197],{"type":45,"value":180},{"type":40,"tag":139,"props":4199,"children":4200},{"class":141,"line":995},[4201,4205,4210,4214,4218,4222,4226,4230,4234],{"type":40,"tag":139,"props":4202,"children":4203},{"style":299},[4204],{"type":45,"value":302},{"type":40,"tag":139,"props":4206,"children":4207},{"style":254},[4208],{"type":45,"value":4209}," text ",{"type":40,"tag":139,"props":4211,"children":4212},{"style":248},[4213],{"type":45,"value":312},{"type":40,"tag":139,"props":4215,"children":4216},{"style":242},[4217],{"type":45,"value":903},{"type":40,"tag":139,"props":4219,"children":4220},{"style":254},[4221],{"type":45,"value":3762},{"type":40,"tag":139,"props":4223,"children":4224},{"style":248},[4225],{"type":45,"value":356},{"type":40,"tag":139,"props":4227,"children":4228},{"style":320},[4229],{"type":45,"value":3908},{"type":40,"tag":139,"props":4231,"children":4232},{"style":254},[4233],{"type":45,"value":931},{"type":40,"tag":139,"props":4235,"children":4236},{"style":248},[4237],{"type":45,"value":286},{"type":40,"tag":403,"props":4239,"children":4241},{"id":4240},"key-benefits",[4242],{"type":45,"value":4243},"Key Benefits",{"type":40,"tag":68,"props":4245,"children":4246},{},[4247,4257,4267,4277],{"type":40,"tag":72,"props":4248,"children":4249},{},[4250,4255],{"type":40,"tag":76,"props":4251,"children":4252},{},[4253],{"type":45,"value":4254},"Type-safe parameters",{"type":45,"value":4256}," with full IDE autocomplete",{"type":40,"tag":72,"props":4258,"children":4259},{},[4260,4265],{"type":40,"tag":76,"props":4261,"children":4262},{},[4263],{"type":45,"value":4264},"Auto-generated from OpenAPI specs",{"type":45,"value":4266}," - automatically updates with new models",{"type":40,"tag":72,"props":4268,"children":4269},{},[4270,4275],{"type":40,"tag":76,"props":4271,"children":4272},{},[4273],{"type":45,"value":4274},"Multiple consumption patterns",{"type":45,"value":4276}," - text, streaming, structured data",{"type":40,"tag":72,"props":4278,"children":4279},{},[4280,4285],{"type":40,"tag":76,"props":4281,"children":4282},{},[4283],{"type":45,"value":4284},"Automatic tool execution",{"type":45,"value":4286}," with multi-turn support",{"type":40,"tag":117,"props":4288,"children":4289},{},[],{"type":40,"tag":121,"props":4291,"children":4293},{"id":4292},"input-formats",[4294],{"type":45,"value":4295},"Input Formats",{"type":40,"tag":48,"props":4297,"children":4298},{},[4299,4301,4307],{"type":45,"value":4300},"The SDK accepts flexible input types for the ",{"type":40,"tag":54,"props":4302,"children":4304},{"className":4303},[],[4305],{"type":45,"value":4306},"input",{"type":45,"value":4308}," parameter:",{"type":40,"tag":403,"props":4310,"children":4312},{"id":4311},"string-input",[4313],{"type":45,"value":4314},"String Input",{"type":40,"tag":48,"props":4316,"children":4317},{},[4318],{"type":45,"value":4319},"A simple string becomes a user message:",{"type":40,"tag":128,"props":4321,"children":4323},{"className":231,"code":4322,"language":19,"meta":133,"style":133},"const result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Hello, how are you?'\n});\n",[4324],{"type":40,"tag":54,"props":4325,"children":4326},{"__ignoreMap":133},[4327,4362,4389,4413],{"type":40,"tag":139,"props":4328,"children":4329},{"class":141,"line":142},[4330,4334,4338,4342,4346,4350,4354,4358],{"type":40,"tag":139,"props":4331,"children":4332},{"style":299},[4333],{"type":45,"value":302},{"type":40,"tag":139,"props":4335,"children":4336},{"style":254},[4337],{"type":45,"value":646},{"type":40,"tag":139,"props":4339,"children":4340},{"style":248},[4341],{"type":45,"value":312},{"type":40,"tag":139,"props":4343,"children":4344},{"style":254},[4345],{"type":45,"value":655},{"type":40,"tag":139,"props":4347,"children":4348},{"style":248},[4349],{"type":45,"value":356},{"type":40,"tag":139,"props":4351,"children":4352},{"style":320},[4353],{"type":45,"value":59},{"type":40,"tag":139,"props":4355,"children":4356},{"style":254},[4357],{"type":45,"value":327},{"type":40,"tag":139,"props":4359,"children":4360},{"style":248},[4361],{"type":45,"value":332},{"type":40,"tag":139,"props":4363,"children":4364},{"class":141,"line":152},[4365,4369,4373,4377,4381,4385],{"type":40,"tag":139,"props":4366,"children":4367},{"style":338},[4368],{"type":45,"value":679},{"type":40,"tag":139,"props":4370,"children":4371},{"style":248},[4372],{"type":45,"value":346},{"type":40,"tag":139,"props":4374,"children":4375},{"style":248},[4376],{"type":45,"value":272},{"type":40,"tag":139,"props":4378,"children":4379},{"style":162},[4380],{"type":45,"value":692},{"type":40,"tag":139,"props":4382,"children":4383},{"style":248},[4384],{"type":45,"value":281},{"type":40,"tag":139,"props":4386,"children":4387},{"style":248},[4388],{"type":45,"value":701},{"type":40,"tag":139,"props":4390,"children":4391},{"class":141,"line":173},[4392,4396,4400,4404,4409],{"type":40,"tag":139,"props":4393,"children":4394},{"style":338},[4395],{"type":45,"value":709},{"type":40,"tag":139,"props":4397,"children":4398},{"style":248},[4399],{"type":45,"value":346},{"type":40,"tag":139,"props":4401,"children":4402},{"style":248},[4403],{"type":45,"value":272},{"type":40,"tag":139,"props":4405,"children":4406},{"style":162},[4407],{"type":45,"value":4408},"Hello, how are you?",{"type":40,"tag":139,"props":4410,"children":4411},{"style":248},[4412],{"type":45,"value":727},{"type":40,"tag":139,"props":4414,"children":4415},{"class":141,"line":183},[4416,4420,4424],{"type":40,"tag":139,"props":4417,"children":4418},{"style":248},[4419],{"type":45,"value":378},{"type":40,"tag":139,"props":4421,"children":4422},{"style":254},[4423],{"type":45,"value":383},{"type":40,"tag":139,"props":4425,"children":4426},{"style":248},[4427],{"type":45,"value":286},{"type":40,"tag":403,"props":4429,"children":4431},{"id":4430},"message-arrays",[4432],{"type":45,"value":4433},"Message Arrays",{"type":40,"tag":48,"props":4435,"children":4436},{},[4437],{"type":45,"value":4438},"For multi-turn conversations:",{"type":40,"tag":128,"props":4440,"children":4442},{"className":231,"code":4441,"language":19,"meta":133,"style":133},"const result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: [\n    { role: 'user', content: 'What is the capital of France?' },\n    { role: 'assistant', content: 'The capital of France is Paris.' },\n    { role: 'user', content: 'What is its population?' }\n  ]\n});\n",[4443],{"type":40,"tag":54,"props":4444,"children":4445},{"__ignoreMap":133},[4446,4481,4508,4524,4585,4642,4699,4707],{"type":40,"tag":139,"props":4447,"children":4448},{"class":141,"line":142},[4449,4453,4457,4461,4465,4469,4473,4477],{"type":40,"tag":139,"props":4450,"children":4451},{"style":299},[4452],{"type":45,"value":302},{"type":40,"tag":139,"props":4454,"children":4455},{"style":254},[4456],{"type":45,"value":646},{"type":40,"tag":139,"props":4458,"children":4459},{"style":248},[4460],{"type":45,"value":312},{"type":40,"tag":139,"props":4462,"children":4463},{"style":254},[4464],{"type":45,"value":655},{"type":40,"tag":139,"props":4466,"children":4467},{"style":248},[4468],{"type":45,"value":356},{"type":40,"tag":139,"props":4470,"children":4471},{"style":320},[4472],{"type":45,"value":59},{"type":40,"tag":139,"props":4474,"children":4475},{"style":254},[4476],{"type":45,"value":327},{"type":40,"tag":139,"props":4478,"children":4479},{"style":248},[4480],{"type":45,"value":332},{"type":40,"tag":139,"props":4482,"children":4483},{"class":141,"line":152},[4484,4488,4492,4496,4500,4504],{"type":40,"tag":139,"props":4485,"children":4486},{"style":338},[4487],{"type":45,"value":679},{"type":40,"tag":139,"props":4489,"children":4490},{"style":248},[4491],{"type":45,"value":346},{"type":40,"tag":139,"props":4493,"children":4494},{"style":248},[4495],{"type":45,"value":272},{"type":40,"tag":139,"props":4497,"children":4498},{"style":162},[4499],{"type":45,"value":692},{"type":40,"tag":139,"props":4501,"children":4502},{"style":248},[4503],{"type":45,"value":281},{"type":40,"tag":139,"props":4505,"children":4506},{"style":248},[4507],{"type":45,"value":701},{"type":40,"tag":139,"props":4509,"children":4510},{"class":141,"line":173},[4511,4515,4519],{"type":40,"tag":139,"props":4512,"children":4513},{"style":338},[4514],{"type":45,"value":709},{"type":40,"tag":139,"props":4516,"children":4517},{"style":248},[4518],{"type":45,"value":346},{"type":40,"tag":139,"props":4520,"children":4521},{"style":254},[4522],{"type":45,"value":4523}," [\n",{"type":40,"tag":139,"props":4525,"children":4526},{"class":141,"line":183},[4527,4532,4537,4541,4545,4550,4554,4558,4563,4567,4571,4576,4580],{"type":40,"tag":139,"props":4528,"children":4529},{"style":248},[4530],{"type":45,"value":4531},"    {",{"type":40,"tag":139,"props":4533,"children":4534},{"style":338},[4535],{"type":45,"value":4536}," role",{"type":40,"tag":139,"props":4538,"children":4539},{"style":248},[4540],{"type":45,"value":346},{"type":40,"tag":139,"props":4542,"children":4543},{"style":248},[4544],{"type":45,"value":272},{"type":40,"tag":139,"props":4546,"children":4547},{"style":162},[4548],{"type":45,"value":4549},"user",{"type":40,"tag":139,"props":4551,"children":4552},{"style":248},[4553],{"type":45,"value":281},{"type":40,"tag":139,"props":4555,"children":4556},{"style":248},[4557],{"type":45,"value":974},{"type":40,"tag":139,"props":4559,"children":4560},{"style":338},[4561],{"type":45,"value":4562}," content",{"type":40,"tag":139,"props":4564,"children":4565},{"style":248},[4566],{"type":45,"value":346},{"type":40,"tag":139,"props":4568,"children":4569},{"style":248},[4570],{"type":45,"value":272},{"type":40,"tag":139,"props":4572,"children":4573},{"style":162},[4574],{"type":45,"value":4575},"What is the capital of France?",{"type":40,"tag":139,"props":4577,"children":4578},{"style":248},[4579],{"type":45,"value":281},{"type":40,"tag":139,"props":4581,"children":4582},{"style":248},[4583],{"type":45,"value":4584}," },\n",{"type":40,"tag":139,"props":4586,"children":4587},{"class":141,"line":192},[4588,4592,4596,4600,4604,4609,4613,4617,4621,4625,4629,4634,4638],{"type":40,"tag":139,"props":4589,"children":4590},{"style":248},[4591],{"type":45,"value":4531},{"type":40,"tag":139,"props":4593,"children":4594},{"style":338},[4595],{"type":45,"value":4536},{"type":40,"tag":139,"props":4597,"children":4598},{"style":248},[4599],{"type":45,"value":346},{"type":40,"tag":139,"props":4601,"children":4602},{"style":248},[4603],{"type":45,"value":272},{"type":40,"tag":139,"props":4605,"children":4606},{"style":162},[4607],{"type":45,"value":4608},"assistant",{"type":40,"tag":139,"props":4610,"children":4611},{"style":248},[4612],{"type":45,"value":281},{"type":40,"tag":139,"props":4614,"children":4615},{"style":248},[4616],{"type":45,"value":974},{"type":40,"tag":139,"props":4618,"children":4619},{"style":338},[4620],{"type":45,"value":4562},{"type":40,"tag":139,"props":4622,"children":4623},{"style":248},[4624],{"type":45,"value":346},{"type":40,"tag":139,"props":4626,"children":4627},{"style":248},[4628],{"type":45,"value":272},{"type":40,"tag":139,"props":4630,"children":4631},{"style":162},[4632],{"type":45,"value":4633},"The capital of France is Paris.",{"type":40,"tag":139,"props":4635,"children":4636},{"style":248},[4637],{"type":45,"value":281},{"type":40,"tag":139,"props":4639,"children":4640},{"style":248},[4641],{"type":45,"value":4584},{"type":40,"tag":139,"props":4643,"children":4644},{"class":141,"line":995},[4645,4649,4653,4657,4661,4665,4669,4673,4677,4681,4685,4690,4694],{"type":40,"tag":139,"props":4646,"children":4647},{"style":248},[4648],{"type":45,"value":4531},{"type":40,"tag":139,"props":4650,"children":4651},{"style":338},[4652],{"type":45,"value":4536},{"type":40,"tag":139,"props":4654,"children":4655},{"style":248},[4656],{"type":45,"value":346},{"type":40,"tag":139,"props":4658,"children":4659},{"style":248},[4660],{"type":45,"value":272},{"type":40,"tag":139,"props":4662,"children":4663},{"style":162},[4664],{"type":45,"value":4549},{"type":40,"tag":139,"props":4666,"children":4667},{"style":248},[4668],{"type":45,"value":281},{"type":40,"tag":139,"props":4670,"children":4671},{"style":248},[4672],{"type":45,"value":974},{"type":40,"tag":139,"props":4674,"children":4675},{"style":338},[4676],{"type":45,"value":4562},{"type":40,"tag":139,"props":4678,"children":4679},{"style":248},[4680],{"type":45,"value":346},{"type":40,"tag":139,"props":4682,"children":4683},{"style":248},[4684],{"type":45,"value":272},{"type":40,"tag":139,"props":4686,"children":4687},{"style":162},[4688],{"type":45,"value":4689},"What is its population?",{"type":40,"tag":139,"props":4691,"children":4692},{"style":248},[4693],{"type":45,"value":281},{"type":40,"tag":139,"props":4695,"children":4696},{"style":248},[4697],{"type":45,"value":4698}," }\n",{"type":40,"tag":139,"props":4700,"children":4701},{"class":141,"line":1213},[4702],{"type":40,"tag":139,"props":4703,"children":4704},{"style":254},[4705],{"type":45,"value":4706},"  ]\n",{"type":40,"tag":139,"props":4708,"children":4709},{"class":141,"line":1229},[4710,4714,4718],{"type":40,"tag":139,"props":4711,"children":4712},{"style":248},[4713],{"type":45,"value":378},{"type":40,"tag":139,"props":4715,"children":4716},{"style":254},[4717],{"type":45,"value":383},{"type":40,"tag":139,"props":4719,"children":4720},{"style":248},[4721],{"type":45,"value":286},{"type":40,"tag":403,"props":4723,"children":4725},{"id":4724},"multimodal-content",[4726],{"type":45,"value":4727},"Multimodal Content",{"type":40,"tag":48,"props":4729,"children":4730},{},[4731],{"type":45,"value":4732},"Including images and text:",{"type":40,"tag":128,"props":4734,"children":4736},{"className":231,"code":4735,"language":19,"meta":133,"style":133},"const result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: [\n    {\n      role: 'user',\n      content: [\n        { type: 'text', text: 'What is in this image?' },\n        { type: 'image_url', image_url: { url: 'https:\u002F\u002Fexample.com\u002Fimage.png' } }\n      ]\n    }\n  ]\n});\n",[4737],{"type":40,"tag":54,"props":4738,"children":4739},{"__ignoreMap":133},[4740,4775,4802,4817,4825,4853,4869,4927,5002,5010,5018,5025],{"type":40,"tag":139,"props":4741,"children":4742},{"class":141,"line":142},[4743,4747,4751,4755,4759,4763,4767,4771],{"type":40,"tag":139,"props":4744,"children":4745},{"style":299},[4746],{"type":45,"value":302},{"type":40,"tag":139,"props":4748,"children":4749},{"style":254},[4750],{"type":45,"value":646},{"type":40,"tag":139,"props":4752,"children":4753},{"style":248},[4754],{"type":45,"value":312},{"type":40,"tag":139,"props":4756,"children":4757},{"style":254},[4758],{"type":45,"value":655},{"type":40,"tag":139,"props":4760,"children":4761},{"style":248},[4762],{"type":45,"value":356},{"type":40,"tag":139,"props":4764,"children":4765},{"style":320},[4766],{"type":45,"value":59},{"type":40,"tag":139,"props":4768,"children":4769},{"style":254},[4770],{"type":45,"value":327},{"type":40,"tag":139,"props":4772,"children":4773},{"style":248},[4774],{"type":45,"value":332},{"type":40,"tag":139,"props":4776,"children":4777},{"class":141,"line":152},[4778,4782,4786,4790,4794,4798],{"type":40,"tag":139,"props":4779,"children":4780},{"style":338},[4781],{"type":45,"value":679},{"type":40,"tag":139,"props":4783,"children":4784},{"style":248},[4785],{"type":45,"value":346},{"type":40,"tag":139,"props":4787,"children":4788},{"style":248},[4789],{"type":45,"value":272},{"type":40,"tag":139,"props":4791,"children":4792},{"style":162},[4793],{"type":45,"value":692},{"type":40,"tag":139,"props":4795,"children":4796},{"style":248},[4797],{"type":45,"value":281},{"type":40,"tag":139,"props":4799,"children":4800},{"style":248},[4801],{"type":45,"value":701},{"type":40,"tag":139,"props":4803,"children":4804},{"class":141,"line":173},[4805,4809,4813],{"type":40,"tag":139,"props":4806,"children":4807},{"style":338},[4808],{"type":45,"value":709},{"type":40,"tag":139,"props":4810,"children":4811},{"style":248},[4812],{"type":45,"value":346},{"type":40,"tag":139,"props":4814,"children":4815},{"style":254},[4816],{"type":45,"value":4523},{"type":40,"tag":139,"props":4818,"children":4819},{"class":141,"line":183},[4820],{"type":40,"tag":139,"props":4821,"children":4822},{"style":248},[4823],{"type":45,"value":4824},"    {\n",{"type":40,"tag":139,"props":4826,"children":4827},{"class":141,"line":192},[4828,4833,4837,4841,4845,4849],{"type":40,"tag":139,"props":4829,"children":4830},{"style":338},[4831],{"type":45,"value":4832},"      role",{"type":40,"tag":139,"props":4834,"children":4835},{"style":248},[4836],{"type":45,"value":346},{"type":40,"tag":139,"props":4838,"children":4839},{"style":248},[4840],{"type":45,"value":272},{"type":40,"tag":139,"props":4842,"children":4843},{"style":162},[4844],{"type":45,"value":4549},{"type":40,"tag":139,"props":4846,"children":4847},{"style":248},[4848],{"type":45,"value":281},{"type":40,"tag":139,"props":4850,"children":4851},{"style":248},[4852],{"type":45,"value":701},{"type":40,"tag":139,"props":4854,"children":4855},{"class":141,"line":995},[4856,4861,4865],{"type":40,"tag":139,"props":4857,"children":4858},{"style":338},[4859],{"type":45,"value":4860},"      content",{"type":40,"tag":139,"props":4862,"children":4863},{"style":248},[4864],{"type":45,"value":346},{"type":40,"tag":139,"props":4866,"children":4867},{"style":254},[4868],{"type":45,"value":4523},{"type":40,"tag":139,"props":4870,"children":4871},{"class":141,"line":1213},[4872,4877,4882,4886,4890,4894,4898,4902,4906,4910,4914,4919,4923],{"type":40,"tag":139,"props":4873,"children":4874},{"style":248},[4875],{"type":45,"value":4876},"        {",{"type":40,"tag":139,"props":4878,"children":4879},{"style":338},[4880],{"type":45,"value":4881}," type",{"type":40,"tag":139,"props":4883,"children":4884},{"style":248},[4885],{"type":45,"value":346},{"type":40,"tag":139,"props":4887,"children":4888},{"style":248},[4889],{"type":45,"value":272},{"type":40,"tag":139,"props":4891,"children":4892},{"style":162},[4893],{"type":45,"value":45},{"type":40,"tag":139,"props":4895,"children":4896},{"style":248},[4897],{"type":45,"value":281},{"type":40,"tag":139,"props":4899,"children":4900},{"style":248},[4901],{"type":45,"value":974},{"type":40,"tag":139,"props":4903,"children":4904},{"style":338},[4905],{"type":45,"value":3887},{"type":40,"tag":139,"props":4907,"children":4908},{"style":248},[4909],{"type":45,"value":346},{"type":40,"tag":139,"props":4911,"children":4912},{"style":248},[4913],{"type":45,"value":272},{"type":40,"tag":139,"props":4915,"children":4916},{"style":162},[4917],{"type":45,"value":4918},"What is in this image?",{"type":40,"tag":139,"props":4920,"children":4921},{"style":248},[4922],{"type":45,"value":281},{"type":40,"tag":139,"props":4924,"children":4925},{"style":248},[4926],{"type":45,"value":4584},{"type":40,"tag":139,"props":4928,"children":4929},{"class":141,"line":1229},[4930,4934,4938,4942,4946,4951,4955,4959,4964,4968,4972,4977,4981,4985,4990,4994,4998],{"type":40,"tag":139,"props":4931,"children":4932},{"style":248},[4933],{"type":45,"value":4876},{"type":40,"tag":139,"props":4935,"children":4936},{"style":338},[4937],{"type":45,"value":4881},{"type":40,"tag":139,"props":4939,"children":4940},{"style":248},[4941],{"type":45,"value":346},{"type":40,"tag":139,"props":4943,"children":4944},{"style":248},[4945],{"type":45,"value":272},{"type":40,"tag":139,"props":4947,"children":4948},{"style":162},[4949],{"type":45,"value":4950},"image_url",{"type":40,"tag":139,"props":4952,"children":4953},{"style":248},[4954],{"type":45,"value":281},{"type":40,"tag":139,"props":4956,"children":4957},{"style":248},[4958],{"type":45,"value":974},{"type":40,"tag":139,"props":4960,"children":4961},{"style":338},[4962],{"type":45,"value":4963}," image_url",{"type":40,"tag":139,"props":4965,"children":4966},{"style":248},[4967],{"type":45,"value":346},{"type":40,"tag":139,"props":4969,"children":4970},{"style":248},[4971],{"type":45,"value":251},{"type":40,"tag":139,"props":4973,"children":4974},{"style":338},[4975],{"type":45,"value":4976}," url",{"type":40,"tag":139,"props":4978,"children":4979},{"style":248},[4980],{"type":45,"value":346},{"type":40,"tag":139,"props":4982,"children":4983},{"style":248},[4984],{"type":45,"value":272},{"type":40,"tag":139,"props":4986,"children":4987},{"style":162},[4988],{"type":45,"value":4989},"https:\u002F\u002Fexample.com\u002Fimage.png",{"type":40,"tag":139,"props":4991,"children":4992},{"style":248},[4993],{"type":45,"value":281},{"type":40,"tag":139,"props":4995,"children":4996},{"style":248},[4997],{"type":45,"value":262},{"type":40,"tag":139,"props":4999,"children":5000},{"style":248},[5001],{"type":45,"value":4698},{"type":40,"tag":139,"props":5003,"children":5004},{"class":141,"line":1237},[5005],{"type":40,"tag":139,"props":5006,"children":5007},{"style":254},[5008],{"type":45,"value":5009},"      ]\n",{"type":40,"tag":139,"props":5011,"children":5012},{"class":141,"line":1246},[5013],{"type":40,"tag":139,"props":5014,"children":5015},{"style":248},[5016],{"type":45,"value":5017},"    }\n",{"type":40,"tag":139,"props":5019,"children":5020},{"class":141,"line":1296},[5021],{"type":40,"tag":139,"props":5022,"children":5023},{"style":254},[5024],{"type":45,"value":4706},{"type":40,"tag":139,"props":5026,"children":5027},{"class":141,"line":1322},[5028,5032,5036],{"type":40,"tag":139,"props":5029,"children":5030},{"style":248},[5031],{"type":45,"value":378},{"type":40,"tag":139,"props":5033,"children":5034},{"style":254},[5035],{"type":45,"value":383},{"type":40,"tag":139,"props":5037,"children":5038},{"style":248},[5039],{"type":45,"value":286},{"type":40,"tag":403,"props":5041,"children":5043},{"id":5042},"system-instructions",[5044],{"type":45,"value":5045},"System Instructions",{"type":40,"tag":48,"props":5047,"children":5048},{},[5049,5051,5057],{"type":45,"value":5050},"Use the ",{"type":40,"tag":54,"props":5052,"children":5054},{"className":5053},[],[5055],{"type":45,"value":5056},"instructions",{"type":45,"value":5058}," parameter for system-level guidance:",{"type":40,"tag":128,"props":5060,"children":5062},{"className":231,"code":5061,"language":19,"meta":133,"style":133},"const result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  instructions: 'You are a helpful coding assistant. Be concise.',\n  input: 'How do I reverse a string in Python?'\n});\n",[5063],{"type":40,"tag":54,"props":5064,"children":5065},{"__ignoreMap":133},[5066,5101,5128,5157,5181],{"type":40,"tag":139,"props":5067,"children":5068},{"class":141,"line":142},[5069,5073,5077,5081,5085,5089,5093,5097],{"type":40,"tag":139,"props":5070,"children":5071},{"style":299},[5072],{"type":45,"value":302},{"type":40,"tag":139,"props":5074,"children":5075},{"style":254},[5076],{"type":45,"value":646},{"type":40,"tag":139,"props":5078,"children":5079},{"style":248},[5080],{"type":45,"value":312},{"type":40,"tag":139,"props":5082,"children":5083},{"style":254},[5084],{"type":45,"value":655},{"type":40,"tag":139,"props":5086,"children":5087},{"style":248},[5088],{"type":45,"value":356},{"type":40,"tag":139,"props":5090,"children":5091},{"style":320},[5092],{"type":45,"value":59},{"type":40,"tag":139,"props":5094,"children":5095},{"style":254},[5096],{"type":45,"value":327},{"type":40,"tag":139,"props":5098,"children":5099},{"style":248},[5100],{"type":45,"value":332},{"type":40,"tag":139,"props":5102,"children":5103},{"class":141,"line":152},[5104,5108,5112,5116,5120,5124],{"type":40,"tag":139,"props":5105,"children":5106},{"style":338},[5107],{"type":45,"value":679},{"type":40,"tag":139,"props":5109,"children":5110},{"style":248},[5111],{"type":45,"value":346},{"type":40,"tag":139,"props":5113,"children":5114},{"style":248},[5115],{"type":45,"value":272},{"type":40,"tag":139,"props":5117,"children":5118},{"style":162},[5119],{"type":45,"value":692},{"type":40,"tag":139,"props":5121,"children":5122},{"style":248},[5123],{"type":45,"value":281},{"type":40,"tag":139,"props":5125,"children":5126},{"style":248},[5127],{"type":45,"value":701},{"type":40,"tag":139,"props":5129,"children":5130},{"class":141,"line":173},[5131,5136,5140,5144,5149,5153],{"type":40,"tag":139,"props":5132,"children":5133},{"style":338},[5134],{"type":45,"value":5135},"  instructions",{"type":40,"tag":139,"props":5137,"children":5138},{"style":248},[5139],{"type":45,"value":346},{"type":40,"tag":139,"props":5141,"children":5142},{"style":248},[5143],{"type":45,"value":272},{"type":40,"tag":139,"props":5145,"children":5146},{"style":162},[5147],{"type":45,"value":5148},"You are a helpful coding assistant. Be concise.",{"type":40,"tag":139,"props":5150,"children":5151},{"style":248},[5152],{"type":45,"value":281},{"type":40,"tag":139,"props":5154,"children":5155},{"style":248},[5156],{"type":45,"value":701},{"type":40,"tag":139,"props":5158,"children":5159},{"class":141,"line":183},[5160,5164,5168,5172,5177],{"type":40,"tag":139,"props":5161,"children":5162},{"style":338},[5163],{"type":45,"value":709},{"type":40,"tag":139,"props":5165,"children":5166},{"style":248},[5167],{"type":45,"value":346},{"type":40,"tag":139,"props":5169,"children":5170},{"style":248},[5171],{"type":45,"value":272},{"type":40,"tag":139,"props":5173,"children":5174},{"style":162},[5175],{"type":45,"value":5176},"How do I reverse a string in Python?",{"type":40,"tag":139,"props":5178,"children":5179},{"style":248},[5180],{"type":45,"value":727},{"type":40,"tag":139,"props":5182,"children":5183},{"class":141,"line":192},[5184,5188,5192],{"type":40,"tag":139,"props":5185,"children":5186},{"style":248},[5187],{"type":45,"value":378},{"type":40,"tag":139,"props":5189,"children":5190},{"style":254},[5191],{"type":45,"value":383},{"type":40,"tag":139,"props":5193,"children":5194},{"style":248},[5195],{"type":45,"value":286},{"type":40,"tag":117,"props":5197,"children":5198},{},[],{"type":40,"tag":121,"props":5200,"children":5202},{"id":5201},"response-methods",[5203],{"type":45,"value":5204},"Response Methods",{"type":40,"tag":48,"props":5206,"children":5207},{},[5208],{"type":45,"value":5209},"The result object provides multiple methods for consuming the response:",{"type":40,"tag":1801,"props":5211,"children":5212},{},[5213,5229],{"type":40,"tag":1805,"props":5214,"children":5215},{},[5216],{"type":40,"tag":1809,"props":5217,"children":5218},{},[5219,5224],{"type":40,"tag":1813,"props":5220,"children":5221},{},[5222],{"type":45,"value":5223},"Method",{"type":40,"tag":1813,"props":5225,"children":5226},{},[5227],{"type":45,"value":5228},"Purpose",{"type":40,"tag":1834,"props":5230,"children":5231},{},[5232,5249,5266,5283,5300],{"type":40,"tag":1809,"props":5233,"children":5234},{},[5235,5244],{"type":40,"tag":1841,"props":5236,"children":5237},{},[5238],{"type":40,"tag":54,"props":5239,"children":5241},{"className":5240},[],[5242],{"type":45,"value":5243},"getText()",{"type":40,"tag":1841,"props":5245,"children":5246},{},[5247],{"type":45,"value":5248},"Get complete text after all tools complete",{"type":40,"tag":1809,"props":5250,"children":5251},{},[5252,5261],{"type":40,"tag":1841,"props":5253,"children":5254},{},[5255],{"type":40,"tag":54,"props":5256,"children":5258},{"className":5257},[],[5259],{"type":45,"value":5260},"getResponse()",{"type":40,"tag":1841,"props":5262,"children":5263},{},[5264],{"type":45,"value":5265},"Full response object with token usage",{"type":40,"tag":1809,"props":5267,"children":5268},{},[5269,5278],{"type":40,"tag":1841,"props":5270,"children":5271},{},[5272],{"type":40,"tag":54,"props":5273,"children":5275},{"className":5274},[],[5276],{"type":45,"value":5277},"getTextStream()",{"type":40,"tag":1841,"props":5279,"children":5280},{},[5281],{"type":45,"value":5282},"Stream text deltas as they arrive",{"type":40,"tag":1809,"props":5284,"children":5285},{},[5286,5295],{"type":40,"tag":1841,"props":5287,"children":5288},{},[5289],{"type":40,"tag":54,"props":5290,"children":5292},{"className":5291},[],[5293],{"type":45,"value":5294},"getReasoningStream()",{"type":40,"tag":1841,"props":5296,"children":5297},{},[5298],{"type":45,"value":5299},"Stream reasoning tokens (for o1\u002Freasoning models)",{"type":40,"tag":1809,"props":5301,"children":5302},{},[5303,5312],{"type":40,"tag":1841,"props":5304,"children":5305},{},[5306],{"type":40,"tag":54,"props":5307,"children":5309},{"className":5308},[],[5310],{"type":45,"value":5311},"getToolCallsStream()",{"type":40,"tag":1841,"props":5313,"children":5314},{},[5315],{"type":45,"value":5316},"Stream tool calls as they complete",{"type":40,"tag":403,"props":5318,"children":5320},{"id":5319},"gettext",[5321],{"type":45,"value":5243},{"type":40,"tag":128,"props":5323,"children":5325},{"className":231,"code":5324,"language":19,"meta":133,"style":133},"const result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Write a haiku about coding'\n});\n\nconst text = await result.getText();\nconsole.log(text);\n",[5326],{"type":40,"tag":54,"props":5327,"children":5328},{"__ignoreMap":133},[5329,5364,5391,5415,5430,5437,5476],{"type":40,"tag":139,"props":5330,"children":5331},{"class":141,"line":142},[5332,5336,5340,5344,5348,5352,5356,5360],{"type":40,"tag":139,"props":5333,"children":5334},{"style":299},[5335],{"type":45,"value":302},{"type":40,"tag":139,"props":5337,"children":5338},{"style":254},[5339],{"type":45,"value":646},{"type":40,"tag":139,"props":5341,"children":5342},{"style":248},[5343],{"type":45,"value":312},{"type":40,"tag":139,"props":5345,"children":5346},{"style":254},[5347],{"type":45,"value":655},{"type":40,"tag":139,"props":5349,"children":5350},{"style":248},[5351],{"type":45,"value":356},{"type":40,"tag":139,"props":5353,"children":5354},{"style":320},[5355],{"type":45,"value":59},{"type":40,"tag":139,"props":5357,"children":5358},{"style":254},[5359],{"type":45,"value":327},{"type":40,"tag":139,"props":5361,"children":5362},{"style":248},[5363],{"type":45,"value":332},{"type":40,"tag":139,"props":5365,"children":5366},{"class":141,"line":152},[5367,5371,5375,5379,5383,5387],{"type":40,"tag":139,"props":5368,"children":5369},{"style":338},[5370],{"type":45,"value":679},{"type":40,"tag":139,"props":5372,"children":5373},{"style":248},[5374],{"type":45,"value":346},{"type":40,"tag":139,"props":5376,"children":5377},{"style":248},[5378],{"type":45,"value":272},{"type":40,"tag":139,"props":5380,"children":5381},{"style":162},[5382],{"type":45,"value":692},{"type":40,"tag":139,"props":5384,"children":5385},{"style":248},[5386],{"type":45,"value":281},{"type":40,"tag":139,"props":5388,"children":5389},{"style":248},[5390],{"type":45,"value":701},{"type":40,"tag":139,"props":5392,"children":5393},{"class":141,"line":173},[5394,5398,5402,5406,5411],{"type":40,"tag":139,"props":5395,"children":5396},{"style":338},[5397],{"type":45,"value":709},{"type":40,"tag":139,"props":5399,"children":5400},{"style":248},[5401],{"type":45,"value":346},{"type":40,"tag":139,"props":5403,"children":5404},{"style":248},[5405],{"type":45,"value":272},{"type":40,"tag":139,"props":5407,"children":5408},{"style":162},[5409],{"type":45,"value":5410},"Write a haiku about coding",{"type":40,"tag":139,"props":5412,"children":5413},{"style":248},[5414],{"type":45,"value":727},{"type":40,"tag":139,"props":5416,"children":5417},{"class":141,"line":183},[5418,5422,5426],{"type":40,"tag":139,"props":5419,"children":5420},{"style":248},[5421],{"type":45,"value":378},{"type":40,"tag":139,"props":5423,"children":5424},{"style":254},[5425],{"type":45,"value":383},{"type":40,"tag":139,"props":5427,"children":5428},{"style":248},[5429],{"type":45,"value":286},{"type":40,"tag":139,"props":5431,"children":5432},{"class":141,"line":192},[5433],{"type":40,"tag":139,"props":5434,"children":5435},{"emptyLinePlaceholder":177},[5436],{"type":45,"value":180},{"type":40,"tag":139,"props":5438,"children":5439},{"class":141,"line":995},[5440,5444,5448,5452,5456,5460,5464,5468,5472],{"type":40,"tag":139,"props":5441,"children":5442},{"style":299},[5443],{"type":45,"value":302},{"type":40,"tag":139,"props":5445,"children":5446},{"style":254},[5447],{"type":45,"value":4209},{"type":40,"tag":139,"props":5449,"children":5450},{"style":248},[5451],{"type":45,"value":312},{"type":40,"tag":139,"props":5453,"children":5454},{"style":242},[5455],{"type":45,"value":903},{"type":40,"tag":139,"props":5457,"children":5458},{"style":254},[5459],{"type":45,"value":3762},{"type":40,"tag":139,"props":5461,"children":5462},{"style":248},[5463],{"type":45,"value":356},{"type":40,"tag":139,"props":5465,"children":5466},{"style":320},[5467],{"type":45,"value":3908},{"type":40,"tag":139,"props":5469,"children":5470},{"style":254},[5471],{"type":45,"value":931},{"type":40,"tag":139,"props":5473,"children":5474},{"style":248},[5475],{"type":45,"value":286},{"type":40,"tag":139,"props":5477,"children":5478},{"class":141,"line":1213},[5479,5483,5487,5491,5496],{"type":40,"tag":139,"props":5480,"children":5481},{"style":254},[5482],{"type":45,"value":943},{"type":40,"tag":139,"props":5484,"children":5485},{"style":248},[5486],{"type":45,"value":356},{"type":40,"tag":139,"props":5488,"children":5489},{"style":320},[5490],{"type":45,"value":952},{"type":40,"tag":139,"props":5492,"children":5493},{"style":254},[5494],{"type":45,"value":5495},"(text)",{"type":40,"tag":139,"props":5497,"children":5498},{"style":248},[5499],{"type":45,"value":286},{"type":40,"tag":403,"props":5501,"children":5503},{"id":5502},"getresponse",[5504],{"type":45,"value":5260},{"type":40,"tag":128,"props":5506,"children":5508},{"className":231,"code":5507,"language":19,"meta":133,"style":133},"const result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Hello!'\n});\n\nconst response = await result.getResponse();\nconsole.log('Text:', response.text);\nconsole.log('Token usage:', response.usage);\n",[5509],{"type":40,"tag":54,"props":5510,"children":5511},{"__ignoreMap":133},[5512,5547,5574,5597,5612,5619,5660,5713],{"type":40,"tag":139,"props":5513,"children":5514},{"class":141,"line":142},[5515,5519,5523,5527,5531,5535,5539,5543],{"type":40,"tag":139,"props":5516,"children":5517},{"style":299},[5518],{"type":45,"value":302},{"type":40,"tag":139,"props":5520,"children":5521},{"style":254},[5522],{"type":45,"value":646},{"type":40,"tag":139,"props":5524,"children":5525},{"style":248},[5526],{"type":45,"value":312},{"type":40,"tag":139,"props":5528,"children":5529},{"style":254},[5530],{"type":45,"value":655},{"type":40,"tag":139,"props":5532,"children":5533},{"style":248},[5534],{"type":45,"value":356},{"type":40,"tag":139,"props":5536,"children":5537},{"style":320},[5538],{"type":45,"value":59},{"type":40,"tag":139,"props":5540,"children":5541},{"style":254},[5542],{"type":45,"value":327},{"type":40,"tag":139,"props":5544,"children":5545},{"style":248},[5546],{"type":45,"value":332},{"type":40,"tag":139,"props":5548,"children":5549},{"class":141,"line":152},[5550,5554,5558,5562,5566,5570],{"type":40,"tag":139,"props":5551,"children":5552},{"style":338},[5553],{"type":45,"value":679},{"type":40,"tag":139,"props":5555,"children":5556},{"style":248},[5557],{"type":45,"value":346},{"type":40,"tag":139,"props":5559,"children":5560},{"style":248},[5561],{"type":45,"value":272},{"type":40,"tag":139,"props":5563,"children":5564},{"style":162},[5565],{"type":45,"value":692},{"type":40,"tag":139,"props":5567,"children":5568},{"style":248},[5569],{"type":45,"value":281},{"type":40,"tag":139,"props":5571,"children":5572},{"style":248},[5573],{"type":45,"value":701},{"type":40,"tag":139,"props":5575,"children":5576},{"class":141,"line":173},[5577,5581,5585,5589,5593],{"type":40,"tag":139,"props":5578,"children":5579},{"style":338},[5580],{"type":45,"value":709},{"type":40,"tag":139,"props":5582,"children":5583},{"style":248},[5584],{"type":45,"value":346},{"type":40,"tag":139,"props":5586,"children":5587},{"style":248},[5588],{"type":45,"value":272},{"type":40,"tag":139,"props":5590,"children":5591},{"style":162},[5592],{"type":45,"value":722},{"type":40,"tag":139,"props":5594,"children":5595},{"style":248},[5596],{"type":45,"value":727},{"type":40,"tag":139,"props":5598,"children":5599},{"class":141,"line":183},[5600,5604,5608],{"type":40,"tag":139,"props":5601,"children":5602},{"style":248},[5603],{"type":45,"value":378},{"type":40,"tag":139,"props":5605,"children":5606},{"style":254},[5607],{"type":45,"value":383},{"type":40,"tag":139,"props":5609,"children":5610},{"style":248},[5611],{"type":45,"value":286},{"type":40,"tag":139,"props":5613,"children":5614},{"class":141,"line":192},[5615],{"type":40,"tag":139,"props":5616,"children":5617},{"emptyLinePlaceholder":177},[5618],{"type":45,"value":180},{"type":40,"tag":139,"props":5620,"children":5621},{"class":141,"line":995},[5622,5626,5631,5635,5639,5643,5647,5652,5656],{"type":40,"tag":139,"props":5623,"children":5624},{"style":299},[5625],{"type":45,"value":302},{"type":40,"tag":139,"props":5627,"children":5628},{"style":254},[5629],{"type":45,"value":5630}," response ",{"type":40,"tag":139,"props":5632,"children":5633},{"style":248},[5634],{"type":45,"value":312},{"type":40,"tag":139,"props":5636,"children":5637},{"style":242},[5638],{"type":45,"value":903},{"type":40,"tag":139,"props":5640,"children":5641},{"style":254},[5642],{"type":45,"value":3762},{"type":40,"tag":139,"props":5644,"children":5645},{"style":248},[5646],{"type":45,"value":356},{"type":40,"tag":139,"props":5648,"children":5649},{"style":320},[5650],{"type":45,"value":5651},"getResponse",{"type":40,"tag":139,"props":5653,"children":5654},{"style":254},[5655],{"type":45,"value":931},{"type":40,"tag":139,"props":5657,"children":5658},{"style":248},[5659],{"type":45,"value":286},{"type":40,"tag":139,"props":5661,"children":5662},{"class":141,"line":1213},[5663,5667,5671,5675,5679,5683,5688,5692,5696,5700,5704,5709],{"type":40,"tag":139,"props":5664,"children":5665},{"style":254},[5666],{"type":45,"value":943},{"type":40,"tag":139,"props":5668,"children":5669},{"style":248},[5670],{"type":45,"value":356},{"type":40,"tag":139,"props":5672,"children":5673},{"style":320},[5674],{"type":45,"value":952},{"type":40,"tag":139,"props":5676,"children":5677},{"style":254},[5678],{"type":45,"value":327},{"type":40,"tag":139,"props":5680,"children":5681},{"style":248},[5682],{"type":45,"value":281},{"type":40,"tag":139,"props":5684,"children":5685},{"style":162},[5686],{"type":45,"value":5687},"Text:",{"type":40,"tag":139,"props":5689,"children":5690},{"style":248},[5691],{"type":45,"value":281},{"type":40,"tag":139,"props":5693,"children":5694},{"style":248},[5695],{"type":45,"value":974},{"type":40,"tag":139,"props":5697,"children":5698},{"style":254},[5699],{"type":45,"value":3946},{"type":40,"tag":139,"props":5701,"children":5702},{"style":248},[5703],{"type":45,"value":356},{"type":40,"tag":139,"props":5705,"children":5706},{"style":254},[5707],{"type":45,"value":5708},"text)",{"type":40,"tag":139,"props":5710,"children":5711},{"style":248},[5712],{"type":45,"value":286},{"type":40,"tag":139,"props":5714,"children":5715},{"class":141,"line":1229},[5716,5720,5724,5728,5732,5736,5741,5745,5749,5753,5757,5762],{"type":40,"tag":139,"props":5717,"children":5718},{"style":254},[5719],{"type":45,"value":943},{"type":40,"tag":139,"props":5721,"children":5722},{"style":248},[5723],{"type":45,"value":356},{"type":40,"tag":139,"props":5725,"children":5726},{"style":320},[5727],{"type":45,"value":952},{"type":40,"tag":139,"props":5729,"children":5730},{"style":254},[5731],{"type":45,"value":327},{"type":40,"tag":139,"props":5733,"children":5734},{"style":248},[5735],{"type":45,"value":281},{"type":40,"tag":139,"props":5737,"children":5738},{"style":162},[5739],{"type":45,"value":5740},"Token usage:",{"type":40,"tag":139,"props":5742,"children":5743},{"style":248},[5744],{"type":45,"value":281},{"type":40,"tag":139,"props":5746,"children":5747},{"style":248},[5748],{"type":45,"value":974},{"type":40,"tag":139,"props":5750,"children":5751},{"style":254},[5752],{"type":45,"value":3946},{"type":40,"tag":139,"props":5754,"children":5755},{"style":248},[5756],{"type":45,"value":356},{"type":40,"tag":139,"props":5758,"children":5759},{"style":254},[5760],{"type":45,"value":5761},"usage)",{"type":40,"tag":139,"props":5763,"children":5764},{"style":248},[5765],{"type":45,"value":286},{"type":40,"tag":403,"props":5767,"children":5769},{"id":5768},"gettextstream",[5770],{"type":45,"value":5277},{"type":40,"tag":128,"props":5772,"children":5774},{"className":231,"code":5773,"language":19,"meta":133,"style":133},"const result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Write a short story'\n});\n\nfor await (const delta of result.getTextStream()) {\n  process.stdout.write(delta);\n}\n",[5775],{"type":40,"tag":54,"props":5776,"children":5777},{"__ignoreMap":133},[5778,5813,5840,5864,5879,5886,5938,5981],{"type":40,"tag":139,"props":5779,"children":5780},{"class":141,"line":142},[5781,5785,5789,5793,5797,5801,5805,5809],{"type":40,"tag":139,"props":5782,"children":5783},{"style":299},[5784],{"type":45,"value":302},{"type":40,"tag":139,"props":5786,"children":5787},{"style":254},[5788],{"type":45,"value":646},{"type":40,"tag":139,"props":5790,"children":5791},{"style":248},[5792],{"type":45,"value":312},{"type":40,"tag":139,"props":5794,"children":5795},{"style":254},[5796],{"type":45,"value":655},{"type":40,"tag":139,"props":5798,"children":5799},{"style":248},[5800],{"type":45,"value":356},{"type":40,"tag":139,"props":5802,"children":5803},{"style":320},[5804],{"type":45,"value":59},{"type":40,"tag":139,"props":5806,"children":5807},{"style":254},[5808],{"type":45,"value":327},{"type":40,"tag":139,"props":5810,"children":5811},{"style":248},[5812],{"type":45,"value":332},{"type":40,"tag":139,"props":5814,"children":5815},{"class":141,"line":152},[5816,5820,5824,5828,5832,5836],{"type":40,"tag":139,"props":5817,"children":5818},{"style":338},[5819],{"type":45,"value":679},{"type":40,"tag":139,"props":5821,"children":5822},{"style":248},[5823],{"type":45,"value":346},{"type":40,"tag":139,"props":5825,"children":5826},{"style":248},[5827],{"type":45,"value":272},{"type":40,"tag":139,"props":5829,"children":5830},{"style":162},[5831],{"type":45,"value":692},{"type":40,"tag":139,"props":5833,"children":5834},{"style":248},[5835],{"type":45,"value":281},{"type":40,"tag":139,"props":5837,"children":5838},{"style":248},[5839],{"type":45,"value":701},{"type":40,"tag":139,"props":5841,"children":5842},{"class":141,"line":173},[5843,5847,5851,5855,5860],{"type":40,"tag":139,"props":5844,"children":5845},{"style":338},[5846],{"type":45,"value":709},{"type":40,"tag":139,"props":5848,"children":5849},{"style":248},[5850],{"type":45,"value":346},{"type":40,"tag":139,"props":5852,"children":5853},{"style":248},[5854],{"type":45,"value":272},{"type":40,"tag":139,"props":5856,"children":5857},{"style":162},[5858],{"type":45,"value":5859},"Write a short story",{"type":40,"tag":139,"props":5861,"children":5862},{"style":248},[5863],{"type":45,"value":727},{"type":40,"tag":139,"props":5865,"children":5866},{"class":141,"line":183},[5867,5871,5875],{"type":40,"tag":139,"props":5868,"children":5869},{"style":248},[5870],{"type":45,"value":378},{"type":40,"tag":139,"props":5872,"children":5873},{"style":254},[5874],{"type":45,"value":383},{"type":40,"tag":139,"props":5876,"children":5877},{"style":248},[5878],{"type":45,"value":286},{"type":40,"tag":139,"props":5880,"children":5881},{"class":141,"line":192},[5882],{"type":40,"tag":139,"props":5883,"children":5884},{"emptyLinePlaceholder":177},[5885],{"type":45,"value":180},{"type":40,"tag":139,"props":5887,"children":5888},{"class":141,"line":995},[5889,5894,5898,5902,5906,5911,5916,5920,5924,5929,5934],{"type":40,"tag":139,"props":5890,"children":5891},{"style":242},[5892],{"type":45,"value":5893},"for",{"type":40,"tag":139,"props":5895,"children":5896},{"style":242},[5897],{"type":45,"value":903},{"type":40,"tag":139,"props":5899,"children":5900},{"style":254},[5901],{"type":45,"value":2637},{"type":40,"tag":139,"props":5903,"children":5904},{"style":299},[5905],{"type":45,"value":302},{"type":40,"tag":139,"props":5907,"children":5908},{"style":254},[5909],{"type":45,"value":5910}," delta ",{"type":40,"tag":139,"props":5912,"children":5913},{"style":248},[5914],{"type":45,"value":5915},"of",{"type":40,"tag":139,"props":5917,"children":5918},{"style":254},[5919],{"type":45,"value":3762},{"type":40,"tag":139,"props":5921,"children":5922},{"style":248},[5923],{"type":45,"value":356},{"type":40,"tag":139,"props":5925,"children":5926},{"style":320},[5927],{"type":45,"value":5928},"getTextStream",{"type":40,"tag":139,"props":5930,"children":5931},{"style":254},[5932],{"type":45,"value":5933},"()) ",{"type":40,"tag":139,"props":5935,"children":5936},{"style":248},[5937],{"type":45,"value":332},{"type":40,"tag":139,"props":5939,"children":5940},{"class":141,"line":1213},[5941,5946,5950,5955,5959,5964,5968,5973,5977],{"type":40,"tag":139,"props":5942,"children":5943},{"style":254},[5944],{"type":45,"value":5945},"  process",{"type":40,"tag":139,"props":5947,"children":5948},{"style":248},[5949],{"type":45,"value":356},{"type":40,"tag":139,"props":5951,"children":5952},{"style":254},[5953],{"type":45,"value":5954},"stdout",{"type":40,"tag":139,"props":5956,"children":5957},{"style":248},[5958],{"type":45,"value":356},{"type":40,"tag":139,"props":5960,"children":5961},{"style":320},[5962],{"type":45,"value":5963},"write",{"type":40,"tag":139,"props":5965,"children":5966},{"style":338},[5967],{"type":45,"value":327},{"type":40,"tag":139,"props":5969,"children":5970},{"style":254},[5971],{"type":45,"value":5972},"delta",{"type":40,"tag":139,"props":5974,"children":5975},{"style":338},[5976],{"type":45,"value":383},{"type":40,"tag":139,"props":5978,"children":5979},{"style":248},[5980],{"type":45,"value":286},{"type":40,"tag":139,"props":5982,"children":5983},{"class":141,"line":1229},[5984],{"type":40,"tag":139,"props":5985,"children":5986},{"style":248},[5987],{"type":45,"value":5988},"}\n",{"type":40,"tag":117,"props":5990,"children":5991},{},[],{"type":40,"tag":121,"props":5993,"children":5995},{"id":5994},"tool-system",[5996],{"type":45,"value":5997},"Tool System",{"type":40,"tag":48,"props":5999,"children":6000},{},[6001],{"type":45,"value":6002},"Create strongly-typed tools using Zod schemas for automatic validation and type inference.",{"type":40,"tag":403,"props":6004,"children":6006},{"id":6005},"defining-tools",[6007],{"type":45,"value":6008},"Defining Tools",{"type":40,"tag":128,"props":6010,"children":6012},{"className":231,"code":6011,"language":19,"meta":133,"style":133},"import { tool } from '@openrouter\u002Fagent\u002Ftool';\nimport { z } from 'zod';\n\nconst weatherTool = tool({\n  name: 'get_weather',\n  description: 'Get current weather for a location',\n  inputSchema: z.object({\n    location: z.string().describe('City name'),\n    units: z.enum(['celsius', 'fahrenheit']).optional().default('celsius')\n  }),\n  outputSchema: z.object({\n    temperature: z.number(),\n    conditions: z.string(),\n    humidity: z.number()\n  }),\n  execute: async (params) => {\n    \u002F\u002F Implement weather fetching logic\n    return {\n      temperature: 22,\n      conditions: 'Sunny',\n      humidity: 45\n    };\n  }\n});\n",[6013],{"type":40,"tag":54,"props":6014,"children":6015},{"__ignoreMap":133},[6016,6057,6098,6105,6133,6161,6190,6223,6285,6393,6408,6440,6473,6505,6534,6549,6586,6594,6605,6626,6655,6672,6680,6687],{"type":40,"tag":139,"props":6017,"children":6018},{"class":141,"line":142},[6019,6023,6027,6032,6036,6040,6044,6049,6053],{"type":40,"tag":139,"props":6020,"children":6021},{"style":242},[6022],{"type":45,"value":245},{"type":40,"tag":139,"props":6024,"children":6025},{"style":248},[6026],{"type":45,"value":251},{"type":40,"tag":139,"props":6028,"children":6029},{"style":254},[6030],{"type":45,"value":6031}," tool",{"type":40,"tag":139,"props":6033,"children":6034},{"style":248},[6035],{"type":45,"value":262},{"type":40,"tag":139,"props":6037,"children":6038},{"style":242},[6039],{"type":45,"value":267},{"type":40,"tag":139,"props":6041,"children":6042},{"style":248},[6043],{"type":45,"value":272},{"type":40,"tag":139,"props":6045,"children":6046},{"style":162},[6047],{"type":45,"value":6048},"@openrouter\u002Fagent\u002Ftool",{"type":40,"tag":139,"props":6050,"children":6051},{"style":248},[6052],{"type":45,"value":281},{"type":40,"tag":139,"props":6054,"children":6055},{"style":248},[6056],{"type":45,"value":286},{"type":40,"tag":139,"props":6058,"children":6059},{"class":141,"line":152},[6060,6064,6068,6073,6077,6081,6085,6090,6094],{"type":40,"tag":139,"props":6061,"children":6062},{"style":242},[6063],{"type":45,"value":245},{"type":40,"tag":139,"props":6065,"children":6066},{"style":248},[6067],{"type":45,"value":251},{"type":40,"tag":139,"props":6069,"children":6070},{"style":254},[6071],{"type":45,"value":6072}," z",{"type":40,"tag":139,"props":6074,"children":6075},{"style":248},[6076],{"type":45,"value":262},{"type":40,"tag":139,"props":6078,"children":6079},{"style":242},[6080],{"type":45,"value":267},{"type":40,"tag":139,"props":6082,"children":6083},{"style":248},[6084],{"type":45,"value":272},{"type":40,"tag":139,"props":6086,"children":6087},{"style":162},[6088],{"type":45,"value":6089},"zod",{"type":40,"tag":139,"props":6091,"children":6092},{"style":248},[6093],{"type":45,"value":281},{"type":40,"tag":139,"props":6095,"children":6096},{"style":248},[6097],{"type":45,"value":286},{"type":40,"tag":139,"props":6099,"children":6100},{"class":141,"line":173},[6101],{"type":40,"tag":139,"props":6102,"children":6103},{"emptyLinePlaceholder":177},[6104],{"type":45,"value":180},{"type":40,"tag":139,"props":6106,"children":6107},{"class":141,"line":183},[6108,6112,6117,6121,6125,6129],{"type":40,"tag":139,"props":6109,"children":6110},{"style":299},[6111],{"type":45,"value":302},{"type":40,"tag":139,"props":6113,"children":6114},{"style":254},[6115],{"type":45,"value":6116}," weatherTool ",{"type":40,"tag":139,"props":6118,"children":6119},{"style":248},[6120],{"type":45,"value":312},{"type":40,"tag":139,"props":6122,"children":6123},{"style":320},[6124],{"type":45,"value":6031},{"type":40,"tag":139,"props":6126,"children":6127},{"style":254},[6128],{"type":45,"value":327},{"type":40,"tag":139,"props":6130,"children":6131},{"style":248},[6132],{"type":45,"value":332},{"type":40,"tag":139,"props":6134,"children":6135},{"class":141,"line":192},[6136,6140,6144,6148,6153,6157],{"type":40,"tag":139,"props":6137,"children":6138},{"style":338},[6139],{"type":45,"value":1193},{"type":40,"tag":139,"props":6141,"children":6142},{"style":248},[6143],{"type":45,"value":346},{"type":40,"tag":139,"props":6145,"children":6146},{"style":248},[6147],{"type":45,"value":272},{"type":40,"tag":139,"props":6149,"children":6150},{"style":162},[6151],{"type":45,"value":6152},"get_weather",{"type":40,"tag":139,"props":6154,"children":6155},{"style":248},[6156],{"type":45,"value":281},{"type":40,"tag":139,"props":6158,"children":6159},{"style":248},[6160],{"type":45,"value":701},{"type":40,"tag":139,"props":6162,"children":6163},{"class":141,"line":995},[6164,6169,6173,6177,6182,6186],{"type":40,"tag":139,"props":6165,"children":6166},{"style":338},[6167],{"type":45,"value":6168},"  description",{"type":40,"tag":139,"props":6170,"children":6171},{"style":248},[6172],{"type":45,"value":346},{"type":40,"tag":139,"props":6174,"children":6175},{"style":248},[6176],{"type":45,"value":272},{"type":40,"tag":139,"props":6178,"children":6179},{"style":162},[6180],{"type":45,"value":6181},"Get current weather for a location",{"type":40,"tag":139,"props":6183,"children":6184},{"style":248},[6185],{"type":45,"value":281},{"type":40,"tag":139,"props":6187,"children":6188},{"style":248},[6189],{"type":45,"value":701},{"type":40,"tag":139,"props":6191,"children":6192},{"class":141,"line":1213},[6193,6198,6202,6206,6210,6215,6219],{"type":40,"tag":139,"props":6194,"children":6195},{"style":338},[6196],{"type":45,"value":6197},"  inputSchema",{"type":40,"tag":139,"props":6199,"children":6200},{"style":248},[6201],{"type":45,"value":346},{"type":40,"tag":139,"props":6203,"children":6204},{"style":254},[6205],{"type":45,"value":6072},{"type":40,"tag":139,"props":6207,"children":6208},{"style":248},[6209],{"type":45,"value":356},{"type":40,"tag":139,"props":6211,"children":6212},{"style":320},[6213],{"type":45,"value":6214},"object",{"type":40,"tag":139,"props":6216,"children":6217},{"style":254},[6218],{"type":45,"value":327},{"type":40,"tag":139,"props":6220,"children":6221},{"style":248},[6222],{"type":45,"value":332},{"type":40,"tag":139,"props":6224,"children":6225},{"class":141,"line":1229},[6226,6231,6235,6239,6243,6247,6251,6255,6260,6264,6268,6273,6277,6281],{"type":40,"tag":139,"props":6227,"children":6228},{"style":338},[6229],{"type":45,"value":6230},"    location",{"type":40,"tag":139,"props":6232,"children":6233},{"style":248},[6234],{"type":45,"value":346},{"type":40,"tag":139,"props":6236,"children":6237},{"style":254},[6238],{"type":45,"value":6072},{"type":40,"tag":139,"props":6240,"children":6241},{"style":248},[6242],{"type":45,"value":356},{"type":40,"tag":139,"props":6244,"children":6245},{"style":320},[6246],{"type":45,"value":1858},{"type":40,"tag":139,"props":6248,"children":6249},{"style":254},[6250],{"type":45,"value":931},{"type":40,"tag":139,"props":6252,"children":6253},{"style":248},[6254],{"type":45,"value":356},{"type":40,"tag":139,"props":6256,"children":6257},{"style":320},[6258],{"type":45,"value":6259},"describe",{"type":40,"tag":139,"props":6261,"children":6262},{"style":254},[6263],{"type":45,"value":327},{"type":40,"tag":139,"props":6265,"children":6266},{"style":248},[6267],{"type":45,"value":281},{"type":40,"tag":139,"props":6269,"children":6270},{"style":162},[6271],{"type":45,"value":6272},"City name",{"type":40,"tag":139,"props":6274,"children":6275},{"style":248},[6276],{"type":45,"value":281},{"type":40,"tag":139,"props":6278,"children":6279},{"style":254},[6280],{"type":45,"value":383},{"type":40,"tag":139,"props":6282,"children":6283},{"style":248},[6284],{"type":45,"value":701},{"type":40,"tag":139,"props":6286,"children":6287},{"class":141,"line":1237},[6288,6293,6297,6301,6305,6310,6315,6319,6324,6328,6332,6336,6341,6345,6350,6354,6359,6363,6367,6372,6376,6380,6384,6388],{"type":40,"tag":139,"props":6289,"children":6290},{"style":338},[6291],{"type":45,"value":6292},"    units",{"type":40,"tag":139,"props":6294,"children":6295},{"style":248},[6296],{"type":45,"value":346},{"type":40,"tag":139,"props":6298,"children":6299},{"style":254},[6300],{"type":45,"value":6072},{"type":40,"tag":139,"props":6302,"children":6303},{"style":248},[6304],{"type":45,"value":356},{"type":40,"tag":139,"props":6306,"children":6307},{"style":320},[6308],{"type":45,"value":6309},"enum",{"type":40,"tag":139,"props":6311,"children":6312},{"style":254},[6313],{"type":45,"value":6314},"([",{"type":40,"tag":139,"props":6316,"children":6317},{"style":248},[6318],{"type":45,"value":281},{"type":40,"tag":139,"props":6320,"children":6321},{"style":162},[6322],{"type":45,"value":6323},"celsius",{"type":40,"tag":139,"props":6325,"children":6326},{"style":248},[6327],{"type":45,"value":281},{"type":40,"tag":139,"props":6329,"children":6330},{"style":248},[6331],{"type":45,"value":974},{"type":40,"tag":139,"props":6333,"children":6334},{"style":248},[6335],{"type":45,"value":272},{"type":40,"tag":139,"props":6337,"children":6338},{"style":162},[6339],{"type":45,"value":6340},"fahrenheit",{"type":40,"tag":139,"props":6342,"children":6343},{"style":248},[6344],{"type":45,"value":281},{"type":40,"tag":139,"props":6346,"children":6347},{"style":254},[6348],{"type":45,"value":6349},"])",{"type":40,"tag":139,"props":6351,"children":6352},{"style":248},[6353],{"type":45,"value":356},{"type":40,"tag":139,"props":6355,"children":6356},{"style":320},[6357],{"type":45,"value":6358},"optional",{"type":40,"tag":139,"props":6360,"children":6361},{"style":254},[6362],{"type":45,"value":931},{"type":40,"tag":139,"props":6364,"children":6365},{"style":248},[6366],{"type":45,"value":356},{"type":40,"tag":139,"props":6368,"children":6369},{"style":320},[6370],{"type":45,"value":6371},"default",{"type":40,"tag":139,"props":6373,"children":6374},{"style":254},[6375],{"type":45,"value":327},{"type":40,"tag":139,"props":6377,"children":6378},{"style":248},[6379],{"type":45,"value":281},{"type":40,"tag":139,"props":6381,"children":6382},{"style":162},[6383],{"type":45,"value":6323},{"type":40,"tag":139,"props":6385,"children":6386},{"style":248},[6387],{"type":45,"value":281},{"type":40,"tag":139,"props":6389,"children":6390},{"style":254},[6391],{"type":45,"value":6392},")\n",{"type":40,"tag":139,"props":6394,"children":6395},{"class":141,"line":1246},[6396,6400,6404],{"type":40,"tag":139,"props":6397,"children":6398},{"style":248},[6399],{"type":45,"value":2746},{"type":40,"tag":139,"props":6401,"children":6402},{"style":254},[6403],{"type":45,"value":383},{"type":40,"tag":139,"props":6405,"children":6406},{"style":248},[6407],{"type":45,"value":701},{"type":40,"tag":139,"props":6409,"children":6410},{"class":141,"line":1296},[6411,6416,6420,6424,6428,6432,6436],{"type":40,"tag":139,"props":6412,"children":6413},{"style":338},[6414],{"type":45,"value":6415},"  outputSchema",{"type":40,"tag":139,"props":6417,"children":6418},{"style":248},[6419],{"type":45,"value":346},{"type":40,"tag":139,"props":6421,"children":6422},{"style":254},[6423],{"type":45,"value":6072},{"type":40,"tag":139,"props":6425,"children":6426},{"style":248},[6427],{"type":45,"value":356},{"type":40,"tag":139,"props":6429,"children":6430},{"style":320},[6431],{"type":45,"value":6214},{"type":40,"tag":139,"props":6433,"children":6434},{"style":254},[6435],{"type":45,"value":327},{"type":40,"tag":139,"props":6437,"children":6438},{"style":248},[6439],{"type":45,"value":332},{"type":40,"tag":139,"props":6441,"children":6442},{"class":141,"line":1322},[6443,6448,6452,6456,6460,6465,6469],{"type":40,"tag":139,"props":6444,"children":6445},{"style":338},[6446],{"type":45,"value":6447},"    temperature",{"type":40,"tag":139,"props":6449,"children":6450},{"style":248},[6451],{"type":45,"value":346},{"type":40,"tag":139,"props":6453,"children":6454},{"style":254},[6455],{"type":45,"value":6072},{"type":40,"tag":139,"props":6457,"children":6458},{"style":248},[6459],{"type":45,"value":356},{"type":40,"tag":139,"props":6461,"children":6462},{"style":320},[6463],{"type":45,"value":6464},"number",{"type":40,"tag":139,"props":6466,"children":6467},{"style":254},[6468],{"type":45,"value":931},{"type":40,"tag":139,"props":6470,"children":6471},{"style":248},[6472],{"type":45,"value":701},{"type":40,"tag":139,"props":6474,"children":6475},{"class":141,"line":1338},[6476,6481,6485,6489,6493,6497,6501],{"type":40,"tag":139,"props":6477,"children":6478},{"style":338},[6479],{"type":45,"value":6480},"    conditions",{"type":40,"tag":139,"props":6482,"children":6483},{"style":248},[6484],{"type":45,"value":346},{"type":40,"tag":139,"props":6486,"children":6487},{"style":254},[6488],{"type":45,"value":6072},{"type":40,"tag":139,"props":6490,"children":6491},{"style":248},[6492],{"type":45,"value":356},{"type":40,"tag":139,"props":6494,"children":6495},{"style":320},[6496],{"type":45,"value":1858},{"type":40,"tag":139,"props":6498,"children":6499},{"style":254},[6500],{"type":45,"value":931},{"type":40,"tag":139,"props":6502,"children":6503},{"style":248},[6504],{"type":45,"value":701},{"type":40,"tag":139,"props":6506,"children":6507},{"class":141,"line":1346},[6508,6513,6517,6521,6525,6529],{"type":40,"tag":139,"props":6509,"children":6510},{"style":338},[6511],{"type":45,"value":6512},"    humidity",{"type":40,"tag":139,"props":6514,"children":6515},{"style":248},[6516],{"type":45,"value":346},{"type":40,"tag":139,"props":6518,"children":6519},{"style":254},[6520],{"type":45,"value":6072},{"type":40,"tag":139,"props":6522,"children":6523},{"style":248},[6524],{"type":45,"value":356},{"type":40,"tag":139,"props":6526,"children":6527},{"style":320},[6528],{"type":45,"value":6464},{"type":40,"tag":139,"props":6530,"children":6531},{"style":254},[6532],{"type":45,"value":6533},"()\n",{"type":40,"tag":139,"props":6535,"children":6536},{"class":141,"line":1355},[6537,6541,6545],{"type":40,"tag":139,"props":6538,"children":6539},{"style":248},[6540],{"type":45,"value":2746},{"type":40,"tag":139,"props":6542,"children":6543},{"style":254},[6544],{"type":45,"value":383},{"type":40,"tag":139,"props":6546,"children":6547},{"style":248},[6548],{"type":45,"value":701},{"type":40,"tag":139,"props":6550,"children":6551},{"class":141,"line":1393},[6552,6557,6561,6565,6569,6574,6578,6582],{"type":40,"tag":139,"props":6553,"children":6554},{"style":320},[6555],{"type":45,"value":6556},"  execute",{"type":40,"tag":139,"props":6558,"children":6559},{"style":248},[6560],{"type":45,"value":346},{"type":40,"tag":139,"props":6562,"children":6563},{"style":299},[6564],{"type":45,"value":2632},{"type":40,"tag":139,"props":6566,"children":6567},{"style":248},[6568],{"type":45,"value":2637},{"type":40,"tag":139,"props":6570,"children":6571},{"style":2640},[6572],{"type":45,"value":6573},"params",{"type":40,"tag":139,"props":6575,"children":6576},{"style":248},[6577],{"type":45,"value":383},{"type":40,"tag":139,"props":6579,"children":6580},{"style":299},[6581],{"type":45,"value":2661},{"type":40,"tag":139,"props":6583,"children":6584},{"style":248},[6585],{"type":45,"value":1436},{"type":40,"tag":139,"props":6587,"children":6588},{"class":141,"line":1421},[6589],{"type":40,"tag":139,"props":6590,"children":6591},{"style":146},[6592],{"type":45,"value":6593},"    \u002F\u002F Implement weather fetching logic\n",{"type":40,"tag":139,"props":6595,"children":6596},{"class":141,"line":1439},[6597,6601],{"type":40,"tag":139,"props":6598,"children":6599},{"style":242},[6600],{"type":45,"value":3055},{"type":40,"tag":139,"props":6602,"children":6603},{"style":248},[6604],{"type":45,"value":1436},{"type":40,"tag":139,"props":6606,"children":6607},{"class":141,"line":1465},[6608,6613,6617,6622],{"type":40,"tag":139,"props":6609,"children":6610},{"style":338},[6611],{"type":45,"value":6612},"      temperature",{"type":40,"tag":139,"props":6614,"children":6615},{"style":248},[6616],{"type":45,"value":346},{"type":40,"tag":139,"props":6618,"children":6619},{"style":3075},[6620],{"type":45,"value":6621}," 22",{"type":40,"tag":139,"props":6623,"children":6624},{"style":248},[6625],{"type":45,"value":701},{"type":40,"tag":139,"props":6627,"children":6628},{"class":141,"line":1474},[6629,6634,6638,6642,6647,6651],{"type":40,"tag":139,"props":6630,"children":6631},{"style":338},[6632],{"type":45,"value":6633},"      conditions",{"type":40,"tag":139,"props":6635,"children":6636},{"style":248},[6637],{"type":45,"value":346},{"type":40,"tag":139,"props":6639,"children":6640},{"style":248},[6641],{"type":45,"value":272},{"type":40,"tag":139,"props":6643,"children":6644},{"style":162},[6645],{"type":45,"value":6646},"Sunny",{"type":40,"tag":139,"props":6648,"children":6649},{"style":248},[6650],{"type":45,"value":281},{"type":40,"tag":139,"props":6652,"children":6653},{"style":248},[6654],{"type":45,"value":701},{"type":40,"tag":139,"props":6656,"children":6657},{"class":141,"line":1490},[6658,6663,6667],{"type":40,"tag":139,"props":6659,"children":6660},{"style":338},[6661],{"type":45,"value":6662},"      humidity",{"type":40,"tag":139,"props":6664,"children":6665},{"style":248},[6666],{"type":45,"value":346},{"type":40,"tag":139,"props":6668,"children":6669},{"style":3075},[6670],{"type":45,"value":6671}," 45\n",{"type":40,"tag":139,"props":6673,"children":6674},{"class":141,"line":1498},[6675],{"type":40,"tag":139,"props":6676,"children":6677},{"style":248},[6678],{"type":45,"value":6679},"    };\n",{"type":40,"tag":139,"props":6681,"children":6682},{"class":141,"line":1507},[6683],{"type":40,"tag":139,"props":6684,"children":6685},{"style":248},[6686],{"type":45,"value":1471},{"type":40,"tag":139,"props":6688,"children":6689},{"class":141,"line":1544},[6690,6694,6698],{"type":40,"tag":139,"props":6691,"children":6692},{"style":248},[6693],{"type":45,"value":378},{"type":40,"tag":139,"props":6695,"children":6696},{"style":254},[6697],{"type":45,"value":383},{"type":40,"tag":139,"props":6699,"children":6700},{"style":248},[6701],{"type":45,"value":286},{"type":40,"tag":403,"props":6703,"children":6705},{"id":6704},"using-tools-with-callmodel",[6706],{"type":45,"value":6707},"Using Tools with callModel",{"type":40,"tag":128,"props":6709,"children":6711},{"className":231,"code":6710,"language":19,"meta":133,"style":133},"const result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'What is the weather in Paris?',\n  tools: [weatherTool]\n});\n\nconst text = await result.getText();\n\u002F\u002F The SDK automatically executes the tool and continues the conversation\n",[6712],{"type":40,"tag":54,"props":6713,"children":6714},{"__ignoreMap":133},[6715,6750,6777,6805,6822,6837,6844,6883],{"type":40,"tag":139,"props":6716,"children":6717},{"class":141,"line":142},[6718,6722,6726,6730,6734,6738,6742,6746],{"type":40,"tag":139,"props":6719,"children":6720},{"style":299},[6721],{"type":45,"value":302},{"type":40,"tag":139,"props":6723,"children":6724},{"style":254},[6725],{"type":45,"value":646},{"type":40,"tag":139,"props":6727,"children":6728},{"style":248},[6729],{"type":45,"value":312},{"type":40,"tag":139,"props":6731,"children":6732},{"style":254},[6733],{"type":45,"value":655},{"type":40,"tag":139,"props":6735,"children":6736},{"style":248},[6737],{"type":45,"value":356},{"type":40,"tag":139,"props":6739,"children":6740},{"style":320},[6741],{"type":45,"value":59},{"type":40,"tag":139,"props":6743,"children":6744},{"style":254},[6745],{"type":45,"value":327},{"type":40,"tag":139,"props":6747,"children":6748},{"style":248},[6749],{"type":45,"value":332},{"type":40,"tag":139,"props":6751,"children":6752},{"class":141,"line":152},[6753,6757,6761,6765,6769,6773],{"type":40,"tag":139,"props":6754,"children":6755},{"style":338},[6756],{"type":45,"value":679},{"type":40,"tag":139,"props":6758,"children":6759},{"style":248},[6760],{"type":45,"value":346},{"type":40,"tag":139,"props":6762,"children":6763},{"style":248},[6764],{"type":45,"value":272},{"type":40,"tag":139,"props":6766,"children":6767},{"style":162},[6768],{"type":45,"value":692},{"type":40,"tag":139,"props":6770,"children":6771},{"style":248},[6772],{"type":45,"value":281},{"type":40,"tag":139,"props":6774,"children":6775},{"style":248},[6776],{"type":45,"value":701},{"type":40,"tag":139,"props":6778,"children":6779},{"class":141,"line":173},[6780,6784,6788,6792,6797,6801],{"type":40,"tag":139,"props":6781,"children":6782},{"style":338},[6783],{"type":45,"value":709},{"type":40,"tag":139,"props":6785,"children":6786},{"style":248},[6787],{"type":45,"value":346},{"type":40,"tag":139,"props":6789,"children":6790},{"style":248},[6791],{"type":45,"value":272},{"type":40,"tag":139,"props":6793,"children":6794},{"style":162},[6795],{"type":45,"value":6796},"What is the weather in Paris?",{"type":40,"tag":139,"props":6798,"children":6799},{"style":248},[6800],{"type":45,"value":281},{"type":40,"tag":139,"props":6802,"children":6803},{"style":248},[6804],{"type":45,"value":701},{"type":40,"tag":139,"props":6806,"children":6807},{"class":141,"line":183},[6808,6813,6817],{"type":40,"tag":139,"props":6809,"children":6810},{"style":338},[6811],{"type":45,"value":6812},"  tools",{"type":40,"tag":139,"props":6814,"children":6815},{"style":248},[6816],{"type":45,"value":346},{"type":40,"tag":139,"props":6818,"children":6819},{"style":254},[6820],{"type":45,"value":6821}," [weatherTool]\n",{"type":40,"tag":139,"props":6823,"children":6824},{"class":141,"line":192},[6825,6829,6833],{"type":40,"tag":139,"props":6826,"children":6827},{"style":248},[6828],{"type":45,"value":378},{"type":40,"tag":139,"props":6830,"children":6831},{"style":254},[6832],{"type":45,"value":383},{"type":40,"tag":139,"props":6834,"children":6835},{"style":248},[6836],{"type":45,"value":286},{"type":40,"tag":139,"props":6838,"children":6839},{"class":141,"line":995},[6840],{"type":40,"tag":139,"props":6841,"children":6842},{"emptyLinePlaceholder":177},[6843],{"type":45,"value":180},{"type":40,"tag":139,"props":6845,"children":6846},{"class":141,"line":1213},[6847,6851,6855,6859,6863,6867,6871,6875,6879],{"type":40,"tag":139,"props":6848,"children":6849},{"style":299},[6850],{"type":45,"value":302},{"type":40,"tag":139,"props":6852,"children":6853},{"style":254},[6854],{"type":45,"value":4209},{"type":40,"tag":139,"props":6856,"children":6857},{"style":248},[6858],{"type":45,"value":312},{"type":40,"tag":139,"props":6860,"children":6861},{"style":242},[6862],{"type":45,"value":903},{"type":40,"tag":139,"props":6864,"children":6865},{"style":254},[6866],{"type":45,"value":3762},{"type":40,"tag":139,"props":6868,"children":6869},{"style":248},[6870],{"type":45,"value":356},{"type":40,"tag":139,"props":6872,"children":6873},{"style":320},[6874],{"type":45,"value":3908},{"type":40,"tag":139,"props":6876,"children":6877},{"style":254},[6878],{"type":45,"value":931},{"type":40,"tag":139,"props":6880,"children":6881},{"style":248},[6882],{"type":45,"value":286},{"type":40,"tag":139,"props":6884,"children":6885},{"class":141,"line":1229},[6886],{"type":40,"tag":139,"props":6887,"children":6888},{"style":146},[6889],{"type":45,"value":6890},"\u002F\u002F The SDK automatically executes the tool and continues the conversation\n",{"type":40,"tag":403,"props":6892,"children":6894},{"id":6893},"tool-types",[6895],{"type":45,"value":6896},"Tool Types",{"type":40,"tag":415,"props":6898,"children":6900},{"id":6899},"regular-tools",[6901],{"type":45,"value":6902},"Regular Tools",{"type":40,"tag":48,"props":6904,"children":6905},{},[6906],{"type":45,"value":6907},"Standard execute functions that return a result:",{"type":40,"tag":128,"props":6909,"children":6911},{"className":231,"code":6910,"language":19,"meta":133,"style":133},"const calculatorTool = tool({\n  name: 'calculate',\n  description: 'Perform mathematical calculations',\n  inputSchema: z.object({\n    expression: z.string()\n  }),\n  execute: async ({ expression }) => {\n    return { result: eval(expression) };\n  }\n});\n",[6912],{"type":40,"tag":54,"props":6913,"children":6914},{"__ignoreMap":133},[6915,6943,6971,6999,7030,7058,7073,7111,7153,7160],{"type":40,"tag":139,"props":6916,"children":6917},{"class":141,"line":142},[6918,6922,6927,6931,6935,6939],{"type":40,"tag":139,"props":6919,"children":6920},{"style":299},[6921],{"type":45,"value":302},{"type":40,"tag":139,"props":6923,"children":6924},{"style":254},[6925],{"type":45,"value":6926}," calculatorTool ",{"type":40,"tag":139,"props":6928,"children":6929},{"style":248},[6930],{"type":45,"value":312},{"type":40,"tag":139,"props":6932,"children":6933},{"style":320},[6934],{"type":45,"value":6031},{"type":40,"tag":139,"props":6936,"children":6937},{"style":254},[6938],{"type":45,"value":327},{"type":40,"tag":139,"props":6940,"children":6941},{"style":248},[6942],{"type":45,"value":332},{"type":40,"tag":139,"props":6944,"children":6945},{"class":141,"line":152},[6946,6950,6954,6958,6963,6967],{"type":40,"tag":139,"props":6947,"children":6948},{"style":338},[6949],{"type":45,"value":1193},{"type":40,"tag":139,"props":6951,"children":6952},{"style":248},[6953],{"type":45,"value":346},{"type":40,"tag":139,"props":6955,"children":6956},{"style":248},[6957],{"type":45,"value":272},{"type":40,"tag":139,"props":6959,"children":6960},{"style":162},[6961],{"type":45,"value":6962},"calculate",{"type":40,"tag":139,"props":6964,"children":6965},{"style":248},[6966],{"type":45,"value":281},{"type":40,"tag":139,"props":6968,"children":6969},{"style":248},[6970],{"type":45,"value":701},{"type":40,"tag":139,"props":6972,"children":6973},{"class":141,"line":173},[6974,6978,6982,6986,6991,6995],{"type":40,"tag":139,"props":6975,"children":6976},{"style":338},[6977],{"type":45,"value":6168},{"type":40,"tag":139,"props":6979,"children":6980},{"style":248},[6981],{"type":45,"value":346},{"type":40,"tag":139,"props":6983,"children":6984},{"style":248},[6985],{"type":45,"value":272},{"type":40,"tag":139,"props":6987,"children":6988},{"style":162},[6989],{"type":45,"value":6990},"Perform mathematical calculations",{"type":40,"tag":139,"props":6992,"children":6993},{"style":248},[6994],{"type":45,"value":281},{"type":40,"tag":139,"props":6996,"children":6997},{"style":248},[6998],{"type":45,"value":701},{"type":40,"tag":139,"props":7000,"children":7001},{"class":141,"line":183},[7002,7006,7010,7014,7018,7022,7026],{"type":40,"tag":139,"props":7003,"children":7004},{"style":338},[7005],{"type":45,"value":6197},{"type":40,"tag":139,"props":7007,"children":7008},{"style":248},[7009],{"type":45,"value":346},{"type":40,"tag":139,"props":7011,"children":7012},{"style":254},[7013],{"type":45,"value":6072},{"type":40,"tag":139,"props":7015,"children":7016},{"style":248},[7017],{"type":45,"value":356},{"type":40,"tag":139,"props":7019,"children":7020},{"style":320},[7021],{"type":45,"value":6214},{"type":40,"tag":139,"props":7023,"children":7024},{"style":254},[7025],{"type":45,"value":327},{"type":40,"tag":139,"props":7027,"children":7028},{"style":248},[7029],{"type":45,"value":332},{"type":40,"tag":139,"props":7031,"children":7032},{"class":141,"line":192},[7033,7038,7042,7046,7050,7054],{"type":40,"tag":139,"props":7034,"children":7035},{"style":338},[7036],{"type":45,"value":7037},"    expression",{"type":40,"tag":139,"props":7039,"children":7040},{"style":248},[7041],{"type":45,"value":346},{"type":40,"tag":139,"props":7043,"children":7044},{"style":254},[7045],{"type":45,"value":6072},{"type":40,"tag":139,"props":7047,"children":7048},{"style":248},[7049],{"type":45,"value":356},{"type":40,"tag":139,"props":7051,"children":7052},{"style":320},[7053],{"type":45,"value":1858},{"type":40,"tag":139,"props":7055,"children":7056},{"style":254},[7057],{"type":45,"value":6533},{"type":40,"tag":139,"props":7059,"children":7060},{"class":141,"line":995},[7061,7065,7069],{"type":40,"tag":139,"props":7062,"children":7063},{"style":248},[7064],{"type":45,"value":2746},{"type":40,"tag":139,"props":7066,"children":7067},{"style":254},[7068],{"type":45,"value":383},{"type":40,"tag":139,"props":7070,"children":7071},{"style":248},[7072],{"type":45,"value":701},{"type":40,"tag":139,"props":7074,"children":7075},{"class":141,"line":1213},[7076,7080,7084,7088,7093,7098,7103,7107],{"type":40,"tag":139,"props":7077,"children":7078},{"style":320},[7079],{"type":45,"value":6556},{"type":40,"tag":139,"props":7081,"children":7082},{"style":248},[7083],{"type":45,"value":346},{"type":40,"tag":139,"props":7085,"children":7086},{"style":299},[7087],{"type":45,"value":2632},{"type":40,"tag":139,"props":7089,"children":7090},{"style":248},[7091],{"type":45,"value":7092}," ({",{"type":40,"tag":139,"props":7094,"children":7095},{"style":2640},[7096],{"type":45,"value":7097}," expression",{"type":40,"tag":139,"props":7099,"children":7100},{"style":248},[7101],{"type":45,"value":7102}," })",{"type":40,"tag":139,"props":7104,"children":7105},{"style":299},[7106],{"type":45,"value":2661},{"type":40,"tag":139,"props":7108,"children":7109},{"style":248},[7110],{"type":45,"value":1436},{"type":40,"tag":139,"props":7112,"children":7113},{"class":141,"line":1229},[7114,7118,7122,7126,7130,7135,7139,7144,7148],{"type":40,"tag":139,"props":7115,"children":7116},{"style":242},[7117],{"type":45,"value":3055},{"type":40,"tag":139,"props":7119,"children":7120},{"style":248},[7121],{"type":45,"value":251},{"type":40,"tag":139,"props":7123,"children":7124},{"style":338},[7125],{"type":45,"value":3762},{"type":40,"tag":139,"props":7127,"children":7128},{"style":248},[7129],{"type":45,"value":346},{"type":40,"tag":139,"props":7131,"children":7132},{"style":320},[7133],{"type":45,"value":7134}," eval",{"type":40,"tag":139,"props":7136,"children":7137},{"style":338},[7138],{"type":45,"value":327},{"type":40,"tag":139,"props":7140,"children":7141},{"style":254},[7142],{"type":45,"value":7143},"expression",{"type":40,"tag":139,"props":7145,"children":7146},{"style":338},[7147],{"type":45,"value":3042},{"type":40,"tag":139,"props":7149,"children":7150},{"style":248},[7151],{"type":45,"value":7152},"};\n",{"type":40,"tag":139,"props":7154,"children":7155},{"class":141,"line":1237},[7156],{"type":40,"tag":139,"props":7157,"children":7158},{"style":248},[7159],{"type":45,"value":1471},{"type":40,"tag":139,"props":7161,"children":7162},{"class":141,"line":1246},[7163,7167,7171],{"type":40,"tag":139,"props":7164,"children":7165},{"style":248},[7166],{"type":45,"value":378},{"type":40,"tag":139,"props":7168,"children":7169},{"style":254},[7170],{"type":45,"value":383},{"type":40,"tag":139,"props":7172,"children":7173},{"style":248},[7174],{"type":45,"value":286},{"type":40,"tag":415,"props":7176,"children":7178},{"id":7177},"generator-tools",[7179],{"type":45,"value":7180},"Generator Tools",{"type":40,"tag":48,"props":7182,"children":7183},{},[7184,7186,7192],{"type":45,"value":7185},"Yield progress events using ",{"type":40,"tag":54,"props":7187,"children":7189},{"className":7188},[],[7190],{"type":45,"value":7191},"eventSchema",{"type":45,"value":346},{"type":40,"tag":128,"props":7194,"children":7196},{"className":231,"code":7195,"language":19,"meta":133,"style":133},"const searchTool = tool({\n  name: 'web_search',\n  description: 'Search the web',\n  inputSchema: z.object({ query: z.string() }),\n  eventSchema: z.object({\n    type: z.literal('progress'),\n    message: z.string()\n  }),\n  outputSchema: z.object({ results: z.array(z.string()) }),\n  execute: async function* ({ query }) {\n    yield { type: 'progress', message: 'Searching...' };\n    yield { type: 'progress', message: 'Processing results...' };\n    return { results: ['Result 1', 'Result 2'] };\n  }\n});\n",[7197],{"type":40,"tag":54,"props":7198,"children":7199},{"__ignoreMap":133},[7200,7228,7256,7284,7353,7385,7435,7463,7478,7560,7601,7663,7723,7786,7793],{"type":40,"tag":139,"props":7201,"children":7202},{"class":141,"line":142},[7203,7207,7212,7216,7220,7224],{"type":40,"tag":139,"props":7204,"children":7205},{"style":299},[7206],{"type":45,"value":302},{"type":40,"tag":139,"props":7208,"children":7209},{"style":254},[7210],{"type":45,"value":7211}," searchTool ",{"type":40,"tag":139,"props":7213,"children":7214},{"style":248},[7215],{"type":45,"value":312},{"type":40,"tag":139,"props":7217,"children":7218},{"style":320},[7219],{"type":45,"value":6031},{"type":40,"tag":139,"props":7221,"children":7222},{"style":254},[7223],{"type":45,"value":327},{"type":40,"tag":139,"props":7225,"children":7226},{"style":248},[7227],{"type":45,"value":332},{"type":40,"tag":139,"props":7229,"children":7230},{"class":141,"line":152},[7231,7235,7239,7243,7248,7252],{"type":40,"tag":139,"props":7232,"children":7233},{"style":338},[7234],{"type":45,"value":1193},{"type":40,"tag":139,"props":7236,"children":7237},{"style":248},[7238],{"type":45,"value":346},{"type":40,"tag":139,"props":7240,"children":7241},{"style":248},[7242],{"type":45,"value":272},{"type":40,"tag":139,"props":7244,"children":7245},{"style":162},[7246],{"type":45,"value":7247},"web_search",{"type":40,"tag":139,"props":7249,"children":7250},{"style":248},[7251],{"type":45,"value":281},{"type":40,"tag":139,"props":7253,"children":7254},{"style":248},[7255],{"type":45,"value":701},{"type":40,"tag":139,"props":7257,"children":7258},{"class":141,"line":173},[7259,7263,7267,7271,7276,7280],{"type":40,"tag":139,"props":7260,"children":7261},{"style":338},[7262],{"type":45,"value":6168},{"type":40,"tag":139,"props":7264,"children":7265},{"style":248},[7266],{"type":45,"value":346},{"type":40,"tag":139,"props":7268,"children":7269},{"style":248},[7270],{"type":45,"value":272},{"type":40,"tag":139,"props":7272,"children":7273},{"style":162},[7274],{"type":45,"value":7275},"Search the web",{"type":40,"tag":139,"props":7277,"children":7278},{"style":248},[7279],{"type":45,"value":281},{"type":40,"tag":139,"props":7281,"children":7282},{"style":248},[7283],{"type":45,"value":701},{"type":40,"tag":139,"props":7285,"children":7286},{"class":141,"line":183},[7287,7291,7295,7299,7303,7307,7311,7315,7320,7324,7328,7332,7336,7341,7345,7349],{"type":40,"tag":139,"props":7288,"children":7289},{"style":338},[7290],{"type":45,"value":6197},{"type":40,"tag":139,"props":7292,"children":7293},{"style":248},[7294],{"type":45,"value":346},{"type":40,"tag":139,"props":7296,"children":7297},{"style":254},[7298],{"type":45,"value":6072},{"type":40,"tag":139,"props":7300,"children":7301},{"style":248},[7302],{"type":45,"value":356},{"type":40,"tag":139,"props":7304,"children":7305},{"style":320},[7306],{"type":45,"value":6214},{"type":40,"tag":139,"props":7308,"children":7309},{"style":254},[7310],{"type":45,"value":327},{"type":40,"tag":139,"props":7312,"children":7313},{"style":248},[7314],{"type":45,"value":833},{"type":40,"tag":139,"props":7316,"children":7317},{"style":338},[7318],{"type":45,"value":7319}," query",{"type":40,"tag":139,"props":7321,"children":7322},{"style":248},[7323],{"type":45,"value":346},{"type":40,"tag":139,"props":7325,"children":7326},{"style":254},[7327],{"type":45,"value":6072},{"type":40,"tag":139,"props":7329,"children":7330},{"style":248},[7331],{"type":45,"value":356},{"type":40,"tag":139,"props":7333,"children":7334},{"style":320},[7335],{"type":45,"value":1858},{"type":40,"tag":139,"props":7337,"children":7338},{"style":254},[7339],{"type":45,"value":7340},"() ",{"type":40,"tag":139,"props":7342,"children":7343},{"style":248},[7344],{"type":45,"value":378},{"type":40,"tag":139,"props":7346,"children":7347},{"style":254},[7348],{"type":45,"value":383},{"type":40,"tag":139,"props":7350,"children":7351},{"style":248},[7352],{"type":45,"value":701},{"type":40,"tag":139,"props":7354,"children":7355},{"class":141,"line":192},[7356,7361,7365,7369,7373,7377,7381],{"type":40,"tag":139,"props":7357,"children":7358},{"style":338},[7359],{"type":45,"value":7360},"  eventSchema",{"type":40,"tag":139,"props":7362,"children":7363},{"style":248},[7364],{"type":45,"value":346},{"type":40,"tag":139,"props":7366,"children":7367},{"style":254},[7368],{"type":45,"value":6072},{"type":40,"tag":139,"props":7370,"children":7371},{"style":248},[7372],{"type":45,"value":356},{"type":40,"tag":139,"props":7374,"children":7375},{"style":320},[7376],{"type":45,"value":6214},{"type":40,"tag":139,"props":7378,"children":7379},{"style":254},[7380],{"type":45,"value":327},{"type":40,"tag":139,"props":7382,"children":7383},{"style":248},[7384],{"type":45,"value":332},{"type":40,"tag":139,"props":7386,"children":7387},{"class":141,"line":995},[7388,7393,7397,7401,7405,7410,7414,7418,7423,7427,7431],{"type":40,"tag":139,"props":7389,"children":7390},{"style":338},[7391],{"type":45,"value":7392},"    type",{"type":40,"tag":139,"props":7394,"children":7395},{"style":248},[7396],{"type":45,"value":346},{"type":40,"tag":139,"props":7398,"children":7399},{"style":254},[7400],{"type":45,"value":6072},{"type":40,"tag":139,"props":7402,"children":7403},{"style":248},[7404],{"type":45,"value":356},{"type":40,"tag":139,"props":7406,"children":7407},{"style":320},[7408],{"type":45,"value":7409},"literal",{"type":40,"tag":139,"props":7411,"children":7412},{"style":254},[7413],{"type":45,"value":327},{"type":40,"tag":139,"props":7415,"children":7416},{"style":248},[7417],{"type":45,"value":281},{"type":40,"tag":139,"props":7419,"children":7420},{"style":162},[7421],{"type":45,"value":7422},"progress",{"type":40,"tag":139,"props":7424,"children":7425},{"style":248},[7426],{"type":45,"value":281},{"type":40,"tag":139,"props":7428,"children":7429},{"style":254},[7430],{"type":45,"value":383},{"type":40,"tag":139,"props":7432,"children":7433},{"style":248},[7434],{"type":45,"value":701},{"type":40,"tag":139,"props":7436,"children":7437},{"class":141,"line":1213},[7438,7443,7447,7451,7455,7459],{"type":40,"tag":139,"props":7439,"children":7440},{"style":338},[7441],{"type":45,"value":7442},"    message",{"type":40,"tag":139,"props":7444,"children":7445},{"style":248},[7446],{"type":45,"value":346},{"type":40,"tag":139,"props":7448,"children":7449},{"style":254},[7450],{"type":45,"value":6072},{"type":40,"tag":139,"props":7452,"children":7453},{"style":248},[7454],{"type":45,"value":356},{"type":40,"tag":139,"props":7456,"children":7457},{"style":320},[7458],{"type":45,"value":1858},{"type":40,"tag":139,"props":7460,"children":7461},{"style":254},[7462],{"type":45,"value":6533},{"type":40,"tag":139,"props":7464,"children":7465},{"class":141,"line":1229},[7466,7470,7474],{"type":40,"tag":139,"props":7467,"children":7468},{"style":248},[7469],{"type":45,"value":2746},{"type":40,"tag":139,"props":7471,"children":7472},{"style":254},[7473],{"type":45,"value":383},{"type":40,"tag":139,"props":7475,"children":7476},{"style":248},[7477],{"type":45,"value":701},{"type":40,"tag":139,"props":7479,"children":7480},{"class":141,"line":1237},[7481,7485,7489,7493,7497,7501,7505,7509,7514,7518,7522,7526,7531,7536,7540,7544,7548,7552,7556],{"type":40,"tag":139,"props":7482,"children":7483},{"style":338},[7484],{"type":45,"value":6415},{"type":40,"tag":139,"props":7486,"children":7487},{"style":248},[7488],{"type":45,"value":346},{"type":40,"tag":139,"props":7490,"children":7491},{"style":254},[7492],{"type":45,"value":6072},{"type":40,"tag":139,"props":7494,"children":7495},{"style":248},[7496],{"type":45,"value":356},{"type":40,"tag":139,"props":7498,"children":7499},{"style":320},[7500],{"type":45,"value":6214},{"type":40,"tag":139,"props":7502,"children":7503},{"style":254},[7504],{"type":45,"value":327},{"type":40,"tag":139,"props":7506,"children":7507},{"style":248},[7508],{"type":45,"value":833},{"type":40,"tag":139,"props":7510,"children":7511},{"style":338},[7512],{"type":45,"value":7513}," results",{"type":40,"tag":139,"props":7515,"children":7516},{"style":248},[7517],{"type":45,"value":346},{"type":40,"tag":139,"props":7519,"children":7520},{"style":254},[7521],{"type":45,"value":6072},{"type":40,"tag":139,"props":7523,"children":7524},{"style":248},[7525],{"type":45,"value":356},{"type":40,"tag":139,"props":7527,"children":7528},{"style":320},[7529],{"type":45,"value":7530},"array",{"type":40,"tag":139,"props":7532,"children":7533},{"style":254},[7534],{"type":45,"value":7535},"(z",{"type":40,"tag":139,"props":7537,"children":7538},{"style":248},[7539],{"type":45,"value":356},{"type":40,"tag":139,"props":7541,"children":7542},{"style":320},[7543],{"type":45,"value":1858},{"type":40,"tag":139,"props":7545,"children":7546},{"style":254},[7547],{"type":45,"value":5933},{"type":40,"tag":139,"props":7549,"children":7550},{"style":248},[7551],{"type":45,"value":378},{"type":40,"tag":139,"props":7553,"children":7554},{"style":254},[7555],{"type":45,"value":383},{"type":40,"tag":139,"props":7557,"children":7558},{"style":248},[7559],{"type":45,"value":701},{"type":40,"tag":139,"props":7561,"children":7562},{"class":141,"line":1246},[7563,7567,7571,7575,7580,7585,7589,7593,7597],{"type":40,"tag":139,"props":7564,"children":7565},{"style":320},[7566],{"type":45,"value":6556},{"type":40,"tag":139,"props":7568,"children":7569},{"style":248},[7570],{"type":45,"value":346},{"type":40,"tag":139,"props":7572,"children":7573},{"style":299},[7574],{"type":45,"value":2632},{"type":40,"tag":139,"props":7576,"children":7577},{"style":299},[7578],{"type":45,"value":7579}," function",{"type":40,"tag":139,"props":7581,"children":7582},{"style":248},[7583],{"type":45,"value":7584},"*",{"type":40,"tag":139,"props":7586,"children":7587},{"style":248},[7588],{"type":45,"value":7092},{"type":40,"tag":139,"props":7590,"children":7591},{"style":2640},[7592],{"type":45,"value":7319},{"type":40,"tag":139,"props":7594,"children":7595},{"style":248},[7596],{"type":45,"value":7102},{"type":40,"tag":139,"props":7598,"children":7599},{"style":248},[7600],{"type":45,"value":1436},{"type":40,"tag":139,"props":7602,"children":7603},{"class":141,"line":1296},[7604,7609,7613,7617,7621,7625,7629,7633,7637,7642,7646,7650,7655,7659],{"type":40,"tag":139,"props":7605,"children":7606},{"style":242},[7607],{"type":45,"value":7608},"    yield",{"type":40,"tag":139,"props":7610,"children":7611},{"style":248},[7612],{"type":45,"value":251},{"type":40,"tag":139,"props":7614,"children":7615},{"style":338},[7616],{"type":45,"value":4881},{"type":40,"tag":139,"props":7618,"children":7619},{"style":248},[7620],{"type":45,"value":346},{"type":40,"tag":139,"props":7622,"children":7623},{"style":248},[7624],{"type":45,"value":272},{"type":40,"tag":139,"props":7626,"children":7627},{"style":162},[7628],{"type":45,"value":7422},{"type":40,"tag":139,"props":7630,"children":7631},{"style":248},[7632],{"type":45,"value":281},{"type":40,"tag":139,"props":7634,"children":7635},{"style":248},[7636],{"type":45,"value":974},{"type":40,"tag":139,"props":7638,"children":7639},{"style":338},[7640],{"type":45,"value":7641}," message",{"type":40,"tag":139,"props":7643,"children":7644},{"style":248},[7645],{"type":45,"value":346},{"type":40,"tag":139,"props":7647,"children":7648},{"style":248},[7649],{"type":45,"value":272},{"type":40,"tag":139,"props":7651,"children":7652},{"style":162},[7653],{"type":45,"value":7654},"Searching...",{"type":40,"tag":139,"props":7656,"children":7657},{"style":248},[7658],{"type":45,"value":281},{"type":40,"tag":139,"props":7660,"children":7661},{"style":248},[7662],{"type":45,"value":2813},{"type":40,"tag":139,"props":7664,"children":7665},{"class":141,"line":1322},[7666,7670,7674,7678,7682,7686,7690,7694,7698,7702,7706,7710,7715,7719],{"type":40,"tag":139,"props":7667,"children":7668},{"style":242},[7669],{"type":45,"value":7608},{"type":40,"tag":139,"props":7671,"children":7672},{"style":248},[7673],{"type":45,"value":251},{"type":40,"tag":139,"props":7675,"children":7676},{"style":338},[7677],{"type":45,"value":4881},{"type":40,"tag":139,"props":7679,"children":7680},{"style":248},[7681],{"type":45,"value":346},{"type":40,"tag":139,"props":7683,"children":7684},{"style":248},[7685],{"type":45,"value":272},{"type":40,"tag":139,"props":7687,"children":7688},{"style":162},[7689],{"type":45,"value":7422},{"type":40,"tag":139,"props":7691,"children":7692},{"style":248},[7693],{"type":45,"value":281},{"type":40,"tag":139,"props":7695,"children":7696},{"style":248},[7697],{"type":45,"value":974},{"type":40,"tag":139,"props":7699,"children":7700},{"style":338},[7701],{"type":45,"value":7641},{"type":40,"tag":139,"props":7703,"children":7704},{"style":248},[7705],{"type":45,"value":346},{"type":40,"tag":139,"props":7707,"children":7708},{"style":248},[7709],{"type":45,"value":272},{"type":40,"tag":139,"props":7711,"children":7712},{"style":162},[7713],{"type":45,"value":7714},"Processing results...",{"type":40,"tag":139,"props":7716,"children":7717},{"style":248},[7718],{"type":45,"value":281},{"type":40,"tag":139,"props":7720,"children":7721},{"style":248},[7722],{"type":45,"value":2813},{"type":40,"tag":139,"props":7724,"children":7725},{"class":141,"line":1338},[7726,7730,7734,7738,7742,7747,7751,7756,7760,7764,7768,7773,7777,7782],{"type":40,"tag":139,"props":7727,"children":7728},{"style":242},[7729],{"type":45,"value":3055},{"type":40,"tag":139,"props":7731,"children":7732},{"style":248},[7733],{"type":45,"value":251},{"type":40,"tag":139,"props":7735,"children":7736},{"style":338},[7737],{"type":45,"value":7513},{"type":40,"tag":139,"props":7739,"children":7740},{"style":248},[7741],{"type":45,"value":346},{"type":40,"tag":139,"props":7743,"children":7744},{"style":338},[7745],{"type":45,"value":7746}," [",{"type":40,"tag":139,"props":7748,"children":7749},{"style":248},[7750],{"type":45,"value":281},{"type":40,"tag":139,"props":7752,"children":7753},{"style":162},[7754],{"type":45,"value":7755},"Result 1",{"type":40,"tag":139,"props":7757,"children":7758},{"style":248},[7759],{"type":45,"value":281},{"type":40,"tag":139,"props":7761,"children":7762},{"style":248},[7763],{"type":45,"value":974},{"type":40,"tag":139,"props":7765,"children":7766},{"style":248},[7767],{"type":45,"value":272},{"type":40,"tag":139,"props":7769,"children":7770},{"style":162},[7771],{"type":45,"value":7772},"Result 2",{"type":40,"tag":139,"props":7774,"children":7775},{"style":248},[7776],{"type":45,"value":281},{"type":40,"tag":139,"props":7778,"children":7779},{"style":338},[7780],{"type":45,"value":7781},"] ",{"type":40,"tag":139,"props":7783,"children":7784},{"style":248},[7785],{"type":45,"value":7152},{"type":40,"tag":139,"props":7787,"children":7788},{"class":141,"line":1346},[7789],{"type":40,"tag":139,"props":7790,"children":7791},{"style":248},[7792],{"type":45,"value":1471},{"type":40,"tag":139,"props":7794,"children":7795},{"class":141,"line":1355},[7796,7800,7804],{"type":40,"tag":139,"props":7797,"children":7798},{"style":248},[7799],{"type":45,"value":378},{"type":40,"tag":139,"props":7801,"children":7802},{"style":254},[7803],{"type":45,"value":383},{"type":40,"tag":139,"props":7805,"children":7806},{"style":248},[7807],{"type":45,"value":286},{"type":40,"tag":415,"props":7809,"children":7811},{"id":7810},"manual-tools",[7812],{"type":45,"value":7813},"Manual Tools",{"type":40,"tag":48,"props":7815,"children":7816},{},[7817,7819,7825],{"type":45,"value":7818},"Set ",{"type":40,"tag":54,"props":7820,"children":7822},{"className":7821},[],[7823],{"type":45,"value":7824},"execute: false",{"type":45,"value":7826}," to handle tool calls yourself:",{"type":40,"tag":128,"props":7828,"children":7830},{"className":231,"code":7829,"language":19,"meta":133,"style":133},"const manualTool = tool({\n  name: 'user_confirmation',\n  description: 'Request user confirmation',\n  inputSchema: z.object({ message: z.string() }),\n  execute: false\n});\n",[7831],{"type":40,"tag":54,"props":7832,"children":7833},{"__ignoreMap":133},[7834,7862,7890,7918,7985,8002],{"type":40,"tag":139,"props":7835,"children":7836},{"class":141,"line":142},[7837,7841,7846,7850,7854,7858],{"type":40,"tag":139,"props":7838,"children":7839},{"style":299},[7840],{"type":45,"value":302},{"type":40,"tag":139,"props":7842,"children":7843},{"style":254},[7844],{"type":45,"value":7845}," manualTool ",{"type":40,"tag":139,"props":7847,"children":7848},{"style":248},[7849],{"type":45,"value":312},{"type":40,"tag":139,"props":7851,"children":7852},{"style":320},[7853],{"type":45,"value":6031},{"type":40,"tag":139,"props":7855,"children":7856},{"style":254},[7857],{"type":45,"value":327},{"type":40,"tag":139,"props":7859,"children":7860},{"style":248},[7861],{"type":45,"value":332},{"type":40,"tag":139,"props":7863,"children":7864},{"class":141,"line":152},[7865,7869,7873,7877,7882,7886],{"type":40,"tag":139,"props":7866,"children":7867},{"style":338},[7868],{"type":45,"value":1193},{"type":40,"tag":139,"props":7870,"children":7871},{"style":248},[7872],{"type":45,"value":346},{"type":40,"tag":139,"props":7874,"children":7875},{"style":248},[7876],{"type":45,"value":272},{"type":40,"tag":139,"props":7878,"children":7879},{"style":162},[7880],{"type":45,"value":7881},"user_confirmation",{"type":40,"tag":139,"props":7883,"children":7884},{"style":248},[7885],{"type":45,"value":281},{"type":40,"tag":139,"props":7887,"children":7888},{"style":248},[7889],{"type":45,"value":701},{"type":40,"tag":139,"props":7891,"children":7892},{"class":141,"line":173},[7893,7897,7901,7905,7910,7914],{"type":40,"tag":139,"props":7894,"children":7895},{"style":338},[7896],{"type":45,"value":6168},{"type":40,"tag":139,"props":7898,"children":7899},{"style":248},[7900],{"type":45,"value":346},{"type":40,"tag":139,"props":7902,"children":7903},{"style":248},[7904],{"type":45,"value":272},{"type":40,"tag":139,"props":7906,"children":7907},{"style":162},[7908],{"type":45,"value":7909},"Request user confirmation",{"type":40,"tag":139,"props":7911,"children":7912},{"style":248},[7913],{"type":45,"value":281},{"type":40,"tag":139,"props":7915,"children":7916},{"style":248},[7917],{"type":45,"value":701},{"type":40,"tag":139,"props":7919,"children":7920},{"class":141,"line":183},[7921,7925,7929,7933,7937,7941,7945,7949,7953,7957,7961,7965,7969,7973,7977,7981],{"type":40,"tag":139,"props":7922,"children":7923},{"style":338},[7924],{"type":45,"value":6197},{"type":40,"tag":139,"props":7926,"children":7927},{"style":248},[7928],{"type":45,"value":346},{"type":40,"tag":139,"props":7930,"children":7931},{"style":254},[7932],{"type":45,"value":6072},{"type":40,"tag":139,"props":7934,"children":7935},{"style":248},[7936],{"type":45,"value":356},{"type":40,"tag":139,"props":7938,"children":7939},{"style":320},[7940],{"type":45,"value":6214},{"type":40,"tag":139,"props":7942,"children":7943},{"style":254},[7944],{"type":45,"value":327},{"type":40,"tag":139,"props":7946,"children":7947},{"style":248},[7948],{"type":45,"value":833},{"type":40,"tag":139,"props":7950,"children":7951},{"style":338},[7952],{"type":45,"value":7641},{"type":40,"tag":139,"props":7954,"children":7955},{"style":248},[7956],{"type":45,"value":346},{"type":40,"tag":139,"props":7958,"children":7959},{"style":254},[7960],{"type":45,"value":6072},{"type":40,"tag":139,"props":7962,"children":7963},{"style":248},[7964],{"type":45,"value":356},{"type":40,"tag":139,"props":7966,"children":7967},{"style":320},[7968],{"type":45,"value":1858},{"type":40,"tag":139,"props":7970,"children":7971},{"style":254},[7972],{"type":45,"value":7340},{"type":40,"tag":139,"props":7974,"children":7975},{"style":248},[7976],{"type":45,"value":378},{"type":40,"tag":139,"props":7978,"children":7979},{"style":254},[7980],{"type":45,"value":383},{"type":40,"tag":139,"props":7982,"children":7983},{"style":248},[7984],{"type":45,"value":701},{"type":40,"tag":139,"props":7986,"children":7987},{"class":141,"line":192},[7988,7992,7996],{"type":40,"tag":139,"props":7989,"children":7990},{"style":338},[7991],{"type":45,"value":6556},{"type":40,"tag":139,"props":7993,"children":7994},{"style":248},[7995],{"type":45,"value":346},{"type":40,"tag":139,"props":7997,"children":7999},{"style":7998},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[8000],{"type":45,"value":8001}," false\n",{"type":40,"tag":139,"props":8003,"children":8004},{"class":141,"line":995},[8005,8009,8013],{"type":40,"tag":139,"props":8006,"children":8007},{"style":248},[8008],{"type":45,"value":378},{"type":40,"tag":139,"props":8010,"children":8011},{"style":254},[8012],{"type":45,"value":383},{"type":40,"tag":139,"props":8014,"children":8015},{"style":248},[8016],{"type":45,"value":286},{"type":40,"tag":117,"props":8018,"children":8019},{},[],{"type":40,"tag":121,"props":8021,"children":8023},{"id":8022},"multi-turn-conversations-with-stop-conditions",[8024],{"type":45,"value":8025},"Multi-Turn Conversations with Stop Conditions",{"type":40,"tag":48,"props":8027,"children":8028},{},[8029],{"type":45,"value":8030},"Control automatic tool execution with stop conditions:",{"type":40,"tag":128,"props":8032,"children":8034},{"className":231,"code":8033,"language":19,"meta":133,"style":133},"import { stepCountIs, maxCost, hasToolCall } from '@openrouter\u002Fagent\u002Fstop-conditions';\n\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5.2',\n  input: 'Research this topic thoroughly',\n  tools: [searchTool, analyzeTool],\n  stopWhen: [\n    stepCountIs(10),      \u002F\u002F Stop after 10 turns\n    maxCost(1.00),        \u002F\u002F Stop if cost exceeds $1.00\n    hasToolCall('finish') \u002F\u002F Stop when 'finish' tool is called\n  ]\n});\n",[8035],{"type":40,"tag":54,"props":8036,"children":8037},{"__ignoreMap":133},[8038,8097,8104,8139,8167,8195,8224,8240,8270,8300,8334,8341],{"type":40,"tag":139,"props":8039,"children":8040},{"class":141,"line":142},[8041,8045,8049,8054,8058,8063,8067,8072,8076,8080,8084,8089,8093],{"type":40,"tag":139,"props":8042,"children":8043},{"style":242},[8044],{"type":45,"value":245},{"type":40,"tag":139,"props":8046,"children":8047},{"style":248},[8048],{"type":45,"value":251},{"type":40,"tag":139,"props":8050,"children":8051},{"style":254},[8052],{"type":45,"value":8053}," stepCountIs",{"type":40,"tag":139,"props":8055,"children":8056},{"style":248},[8057],{"type":45,"value":974},{"type":40,"tag":139,"props":8059,"children":8060},{"style":254},[8061],{"type":45,"value":8062}," maxCost",{"type":40,"tag":139,"props":8064,"children":8065},{"style":248},[8066],{"type":45,"value":974},{"type":40,"tag":139,"props":8068,"children":8069},{"style":254},[8070],{"type":45,"value":8071}," hasToolCall",{"type":40,"tag":139,"props":8073,"children":8074},{"style":248},[8075],{"type":45,"value":262},{"type":40,"tag":139,"props":8077,"children":8078},{"style":242},[8079],{"type":45,"value":267},{"type":40,"tag":139,"props":8081,"children":8082},{"style":248},[8083],{"type":45,"value":272},{"type":40,"tag":139,"props":8085,"children":8086},{"style":162},[8087],{"type":45,"value":8088},"@openrouter\u002Fagent\u002Fstop-conditions",{"type":40,"tag":139,"props":8090,"children":8091},{"style":248},[8092],{"type":45,"value":281},{"type":40,"tag":139,"props":8094,"children":8095},{"style":248},[8096],{"type":45,"value":286},{"type":40,"tag":139,"props":8098,"children":8099},{"class":141,"line":152},[8100],{"type":40,"tag":139,"props":8101,"children":8102},{"emptyLinePlaceholder":177},[8103],{"type":45,"value":180},{"type":40,"tag":139,"props":8105,"children":8106},{"class":141,"line":173},[8107,8111,8115,8119,8123,8127,8131,8135],{"type":40,"tag":139,"props":8108,"children":8109},{"style":299},[8110],{"type":45,"value":302},{"type":40,"tag":139,"props":8112,"children":8113},{"style":254},[8114],{"type":45,"value":646},{"type":40,"tag":139,"props":8116,"children":8117},{"style":248},[8118],{"type":45,"value":312},{"type":40,"tag":139,"props":8120,"children":8121},{"style":254},[8122],{"type":45,"value":655},{"type":40,"tag":139,"props":8124,"children":8125},{"style":248},[8126],{"type":45,"value":356},{"type":40,"tag":139,"props":8128,"children":8129},{"style":320},[8130],{"type":45,"value":59},{"type":40,"tag":139,"props":8132,"children":8133},{"style":254},[8134],{"type":45,"value":327},{"type":40,"tag":139,"props":8136,"children":8137},{"style":248},[8138],{"type":45,"value":332},{"type":40,"tag":139,"props":8140,"children":8141},{"class":141,"line":183},[8142,8146,8150,8154,8159,8163],{"type":40,"tag":139,"props":8143,"children":8144},{"style":338},[8145],{"type":45,"value":679},{"type":40,"tag":139,"props":8147,"children":8148},{"style":248},[8149],{"type":45,"value":346},{"type":40,"tag":139,"props":8151,"children":8152},{"style":248},[8153],{"type":45,"value":272},{"type":40,"tag":139,"props":8155,"children":8156},{"style":162},[8157],{"type":45,"value":8158},"openai\u002Fgpt-5.2",{"type":40,"tag":139,"props":8160,"children":8161},{"style":248},[8162],{"type":45,"value":281},{"type":40,"tag":139,"props":8164,"children":8165},{"style":248},[8166],{"type":45,"value":701},{"type":40,"tag":139,"props":8168,"children":8169},{"class":141,"line":192},[8170,8174,8178,8182,8187,8191],{"type":40,"tag":139,"props":8171,"children":8172},{"style":338},[8173],{"type":45,"value":709},{"type":40,"tag":139,"props":8175,"children":8176},{"style":248},[8177],{"type":45,"value":346},{"type":40,"tag":139,"props":8179,"children":8180},{"style":248},[8181],{"type":45,"value":272},{"type":40,"tag":139,"props":8183,"children":8184},{"style":162},[8185],{"type":45,"value":8186},"Research this topic thoroughly",{"type":40,"tag":139,"props":8188,"children":8189},{"style":248},[8190],{"type":45,"value":281},{"type":40,"tag":139,"props":8192,"children":8193},{"style":248},[8194],{"type":45,"value":701},{"type":40,"tag":139,"props":8196,"children":8197},{"class":141,"line":995},[8198,8202,8206,8211,8215,8220],{"type":40,"tag":139,"props":8199,"children":8200},{"style":338},[8201],{"type":45,"value":6812},{"type":40,"tag":139,"props":8203,"children":8204},{"style":248},[8205],{"type":45,"value":346},{"type":40,"tag":139,"props":8207,"children":8208},{"style":254},[8209],{"type":45,"value":8210}," [searchTool",{"type":40,"tag":139,"props":8212,"children":8213},{"style":248},[8214],{"type":45,"value":974},{"type":40,"tag":139,"props":8216,"children":8217},{"style":254},[8218],{"type":45,"value":8219}," analyzeTool]",{"type":40,"tag":139,"props":8221,"children":8222},{"style":248},[8223],{"type":45,"value":701},{"type":40,"tag":139,"props":8225,"children":8226},{"class":141,"line":1213},[8227,8232,8236],{"type":40,"tag":139,"props":8228,"children":8229},{"style":338},[8230],{"type":45,"value":8231},"  stopWhen",{"type":40,"tag":139,"props":8233,"children":8234},{"style":248},[8235],{"type":45,"value":346},{"type":40,"tag":139,"props":8237,"children":8238},{"style":254},[8239],{"type":45,"value":4523},{"type":40,"tag":139,"props":8241,"children":8242},{"class":141,"line":1229},[8243,8248,8252,8257,8261,8265],{"type":40,"tag":139,"props":8244,"children":8245},{"style":320},[8246],{"type":45,"value":8247},"    stepCountIs",{"type":40,"tag":139,"props":8249,"children":8250},{"style":254},[8251],{"type":45,"value":327},{"type":40,"tag":139,"props":8253,"children":8254},{"style":3075},[8255],{"type":45,"value":8256},"10",{"type":40,"tag":139,"props":8258,"children":8259},{"style":254},[8260],{"type":45,"value":383},{"type":40,"tag":139,"props":8262,"children":8263},{"style":248},[8264],{"type":45,"value":974},{"type":40,"tag":139,"props":8266,"children":8267},{"style":146},[8268],{"type":45,"value":8269},"      \u002F\u002F Stop after 10 turns\n",{"type":40,"tag":139,"props":8271,"children":8272},{"class":141,"line":1237},[8273,8278,8282,8287,8291,8295],{"type":40,"tag":139,"props":8274,"children":8275},{"style":320},[8276],{"type":45,"value":8277},"    maxCost",{"type":40,"tag":139,"props":8279,"children":8280},{"style":254},[8281],{"type":45,"value":327},{"type":40,"tag":139,"props":8283,"children":8284},{"style":3075},[8285],{"type":45,"value":8286},"1.00",{"type":40,"tag":139,"props":8288,"children":8289},{"style":254},[8290],{"type":45,"value":383},{"type":40,"tag":139,"props":8292,"children":8293},{"style":248},[8294],{"type":45,"value":974},{"type":40,"tag":139,"props":8296,"children":8297},{"style":146},[8298],{"type":45,"value":8299},"        \u002F\u002F Stop if cost exceeds $1.00\n",{"type":40,"tag":139,"props":8301,"children":8302},{"class":141,"line":1246},[8303,8308,8312,8316,8321,8325,8329],{"type":40,"tag":139,"props":8304,"children":8305},{"style":320},[8306],{"type":45,"value":8307},"    hasToolCall",{"type":40,"tag":139,"props":8309,"children":8310},{"style":254},[8311],{"type":45,"value":327},{"type":40,"tag":139,"props":8313,"children":8314},{"style":248},[8315],{"type":45,"value":281},{"type":40,"tag":139,"props":8317,"children":8318},{"style":162},[8319],{"type":45,"value":8320},"finish",{"type":40,"tag":139,"props":8322,"children":8323},{"style":248},[8324],{"type":45,"value":281},{"type":40,"tag":139,"props":8326,"children":8327},{"style":254},[8328],{"type":45,"value":3042},{"type":40,"tag":139,"props":8330,"children":8331},{"style":146},[8332],{"type":45,"value":8333},"\u002F\u002F Stop when 'finish' tool is called\n",{"type":40,"tag":139,"props":8335,"children":8336},{"class":141,"line":1296},[8337],{"type":40,"tag":139,"props":8338,"children":8339},{"style":254},[8340],{"type":45,"value":4706},{"type":40,"tag":139,"props":8342,"children":8343},{"class":141,"line":1322},[8344,8348,8352],{"type":40,"tag":139,"props":8345,"children":8346},{"style":248},[8347],{"type":45,"value":378},{"type":40,"tag":139,"props":8349,"children":8350},{"style":254},[8351],{"type":45,"value":383},{"type":40,"tag":139,"props":8353,"children":8354},{"style":248},[8355],{"type":45,"value":286},{"type":40,"tag":403,"props":8357,"children":8359},{"id":8358},"available-stop-conditions",[8360],{"type":45,"value":8361},"Available Stop Conditions",{"type":40,"tag":1801,"props":8363,"children":8364},{},[8365,8380],{"type":40,"tag":1805,"props":8366,"children":8367},{},[8368],{"type":40,"tag":1809,"props":8369,"children":8370},{},[8371,8376],{"type":40,"tag":1813,"props":8372,"children":8373},{},[8374],{"type":45,"value":8375},"Condition",{"type":40,"tag":1813,"props":8377,"children":8378},{},[8379],{"type":45,"value":1832},{"type":40,"tag":1834,"props":8381,"children":8382},{},[8383,8400,8417],{"type":40,"tag":1809,"props":8384,"children":8385},{},[8386,8395],{"type":40,"tag":1841,"props":8387,"children":8388},{},[8389],{"type":40,"tag":54,"props":8390,"children":8392},{"className":8391},[],[8393],{"type":45,"value":8394},"stepCountIs(n)",{"type":40,"tag":1841,"props":8396,"children":8397},{},[8398],{"type":45,"value":8399},"Stop after n turns",{"type":40,"tag":1809,"props":8401,"children":8402},{},[8403,8412],{"type":40,"tag":1841,"props":8404,"children":8405},{},[8406],{"type":40,"tag":54,"props":8407,"children":8409},{"className":8408},[],[8410],{"type":45,"value":8411},"maxCost(amount)",{"type":40,"tag":1841,"props":8413,"children":8414},{},[8415],{"type":45,"value":8416},"Stop when cost exceeds amount",{"type":40,"tag":1809,"props":8418,"children":8419},{},[8420,8429],{"type":40,"tag":1841,"props":8421,"children":8422},{},[8423],{"type":40,"tag":54,"props":8424,"children":8426},{"className":8425},[],[8427],{"type":45,"value":8428},"hasToolCall(name)",{"type":40,"tag":1841,"props":8430,"children":8431},{},[8432],{"type":45,"value":8433},"Stop when specific tool is called",{"type":40,"tag":403,"props":8435,"children":8437},{"id":8436},"custom-stop-conditions",[8438],{"type":45,"value":8439},"Custom Stop Conditions",{"type":40,"tag":128,"props":8441,"children":8443},{"className":231,"code":8442,"language":19,"meta":133,"style":133},"const customStop = (context) => {\n  return context.messages.length > 20;\n};\n\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Complex task',\n  tools: [myTool],\n  stopWhen: customStop\n});\n",[8444],{"type":40,"tag":54,"props":8445,"children":8446},{"__ignoreMap":133},[8447,8484,8529,8536,8543,8578,8605,8633,8653,8669],{"type":40,"tag":139,"props":8448,"children":8449},{"class":141,"line":142},[8450,8454,8459,8463,8467,8472,8476,8480],{"type":40,"tag":139,"props":8451,"children":8452},{"style":299},[8453],{"type":45,"value":302},{"type":40,"tag":139,"props":8455,"children":8456},{"style":254},[8457],{"type":45,"value":8458}," customStop ",{"type":40,"tag":139,"props":8460,"children":8461},{"style":248},[8462],{"type":45,"value":312},{"type":40,"tag":139,"props":8464,"children":8465},{"style":248},[8466],{"type":45,"value":2637},{"type":40,"tag":139,"props":8468,"children":8469},{"style":2640},[8470],{"type":45,"value":8471},"context",{"type":40,"tag":139,"props":8473,"children":8474},{"style":248},[8475],{"type":45,"value":383},{"type":40,"tag":139,"props":8477,"children":8478},{"style":299},[8479],{"type":45,"value":2661},{"type":40,"tag":139,"props":8481,"children":8482},{"style":248},[8483],{"type":45,"value":1436},{"type":40,"tag":139,"props":8485,"children":8486},{"class":141,"line":152},[8487,8492,8497,8501,8506,8510,8515,8520,8525],{"type":40,"tag":139,"props":8488,"children":8489},{"style":242},[8490],{"type":45,"value":8491},"  return",{"type":40,"tag":139,"props":8493,"children":8494},{"style":254},[8495],{"type":45,"value":8496}," context",{"type":40,"tag":139,"props":8498,"children":8499},{"style":248},[8500],{"type":45,"value":356},{"type":40,"tag":139,"props":8502,"children":8503},{"style":254},[8504],{"type":45,"value":8505},"messages",{"type":40,"tag":139,"props":8507,"children":8508},{"style":248},[8509],{"type":45,"value":356},{"type":40,"tag":139,"props":8511,"children":8512},{"style":254},[8513],{"type":45,"value":8514},"length",{"type":40,"tag":139,"props":8516,"children":8517},{"style":248},[8518],{"type":45,"value":8519}," >",{"type":40,"tag":139,"props":8521,"children":8522},{"style":3075},[8523],{"type":45,"value":8524}," 20",{"type":40,"tag":139,"props":8526,"children":8527},{"style":248},[8528],{"type":45,"value":286},{"type":40,"tag":139,"props":8530,"children":8531},{"class":141,"line":173},[8532],{"type":40,"tag":139,"props":8533,"children":8534},{"style":248},[8535],{"type":45,"value":7152},{"type":40,"tag":139,"props":8537,"children":8538},{"class":141,"line":183},[8539],{"type":40,"tag":139,"props":8540,"children":8541},{"emptyLinePlaceholder":177},[8542],{"type":45,"value":180},{"type":40,"tag":139,"props":8544,"children":8545},{"class":141,"line":192},[8546,8550,8554,8558,8562,8566,8570,8574],{"type":40,"tag":139,"props":8547,"children":8548},{"style":299},[8549],{"type":45,"value":302},{"type":40,"tag":139,"props":8551,"children":8552},{"style":254},[8553],{"type":45,"value":646},{"type":40,"tag":139,"props":8555,"children":8556},{"style":248},[8557],{"type":45,"value":312},{"type":40,"tag":139,"props":8559,"children":8560},{"style":254},[8561],{"type":45,"value":655},{"type":40,"tag":139,"props":8563,"children":8564},{"style":248},[8565],{"type":45,"value":356},{"type":40,"tag":139,"props":8567,"children":8568},{"style":320},[8569],{"type":45,"value":59},{"type":40,"tag":139,"props":8571,"children":8572},{"style":254},[8573],{"type":45,"value":327},{"type":40,"tag":139,"props":8575,"children":8576},{"style":248},[8577],{"type":45,"value":332},{"type":40,"tag":139,"props":8579,"children":8580},{"class":141,"line":995},[8581,8585,8589,8593,8597,8601],{"type":40,"tag":139,"props":8582,"children":8583},{"style":338},[8584],{"type":45,"value":679},{"type":40,"tag":139,"props":8586,"children":8587},{"style":248},[8588],{"type":45,"value":346},{"type":40,"tag":139,"props":8590,"children":8591},{"style":248},[8592],{"type":45,"value":272},{"type":40,"tag":139,"props":8594,"children":8595},{"style":162},[8596],{"type":45,"value":692},{"type":40,"tag":139,"props":8598,"children":8599},{"style":248},[8600],{"type":45,"value":281},{"type":40,"tag":139,"props":8602,"children":8603},{"style":248},[8604],{"type":45,"value":701},{"type":40,"tag":139,"props":8606,"children":8607},{"class":141,"line":1213},[8608,8612,8616,8620,8625,8629],{"type":40,"tag":139,"props":8609,"children":8610},{"style":338},[8611],{"type":45,"value":709},{"type":40,"tag":139,"props":8613,"children":8614},{"style":248},[8615],{"type":45,"value":346},{"type":40,"tag":139,"props":8617,"children":8618},{"style":248},[8619],{"type":45,"value":272},{"type":40,"tag":139,"props":8621,"children":8622},{"style":162},[8623],{"type":45,"value":8624},"Complex task",{"type":40,"tag":139,"props":8626,"children":8627},{"style":248},[8628],{"type":45,"value":281},{"type":40,"tag":139,"props":8630,"children":8631},{"style":248},[8632],{"type":45,"value":701},{"type":40,"tag":139,"props":8634,"children":8635},{"class":141,"line":1229},[8636,8640,8644,8649],{"type":40,"tag":139,"props":8637,"children":8638},{"style":338},[8639],{"type":45,"value":6812},{"type":40,"tag":139,"props":8641,"children":8642},{"style":248},[8643],{"type":45,"value":346},{"type":40,"tag":139,"props":8645,"children":8646},{"style":254},[8647],{"type":45,"value":8648}," [myTool]",{"type":40,"tag":139,"props":8650,"children":8651},{"style":248},[8652],{"type":45,"value":701},{"type":40,"tag":139,"props":8654,"children":8655},{"class":141,"line":1237},[8656,8660,8664],{"type":40,"tag":139,"props":8657,"children":8658},{"style":338},[8659],{"type":45,"value":8231},{"type":40,"tag":139,"props":8661,"children":8662},{"style":248},[8663],{"type":45,"value":346},{"type":40,"tag":139,"props":8665,"children":8666},{"style":254},[8667],{"type":45,"value":8668}," customStop\n",{"type":40,"tag":139,"props":8670,"children":8671},{"class":141,"line":1246},[8672,8676,8680],{"type":40,"tag":139,"props":8673,"children":8674},{"style":248},[8675],{"type":45,"value":378},{"type":40,"tag":139,"props":8677,"children":8678},{"style":254},[8679],{"type":45,"value":383},{"type":40,"tag":139,"props":8681,"children":8682},{"style":248},[8683],{"type":45,"value":286},{"type":40,"tag":117,"props":8685,"children":8686},{},[],{"type":40,"tag":121,"props":8688,"children":8690},{"id":8689},"dynamic-parameters",[8691],{"type":45,"value":8692},"Dynamic Parameters",{"type":40,"tag":48,"props":8694,"children":8695},{},[8696],{"type":45,"value":8697},"Compute parameters based on conversation context:",{"type":40,"tag":128,"props":8699,"children":8701},{"className":231,"code":8700,"language":19,"meta":133,"style":133},"const result = client.callModel({\n  model: (ctx) => ctx.numberOfTurns > 3 ? 'openai\u002Fgpt-4' : 'openai\u002Fgpt-4o-mini',\n  temperature: (ctx) => ctx.numberOfTurns > 1 ? 0.3 : 0.7,\n  input: 'Hello!'\n});\n",[8702],{"type":40,"tag":54,"props":8703,"children":8704},{"__ignoreMap":133},[8705,8740,8832,8903,8926],{"type":40,"tag":139,"props":8706,"children":8707},{"class":141,"line":142},[8708,8712,8716,8720,8724,8728,8732,8736],{"type":40,"tag":139,"props":8709,"children":8710},{"style":299},[8711],{"type":45,"value":302},{"type":40,"tag":139,"props":8713,"children":8714},{"style":254},[8715],{"type":45,"value":646},{"type":40,"tag":139,"props":8717,"children":8718},{"style":248},[8719],{"type":45,"value":312},{"type":40,"tag":139,"props":8721,"children":8722},{"style":254},[8723],{"type":45,"value":655},{"type":40,"tag":139,"props":8725,"children":8726},{"style":248},[8727],{"type":45,"value":356},{"type":40,"tag":139,"props":8729,"children":8730},{"style":320},[8731],{"type":45,"value":59},{"type":40,"tag":139,"props":8733,"children":8734},{"style":254},[8735],{"type":45,"value":327},{"type":40,"tag":139,"props":8737,"children":8738},{"style":248},[8739],{"type":45,"value":332},{"type":40,"tag":139,"props":8741,"children":8742},{"class":141,"line":152},[8743,8747,8751,8755,8760,8764,8768,8773,8777,8782,8787,8792,8797,8801,8806,8810,8815,8819,8824,8828],{"type":40,"tag":139,"props":8744,"children":8745},{"style":320},[8746],{"type":45,"value":679},{"type":40,"tag":139,"props":8748,"children":8749},{"style":248},[8750],{"type":45,"value":346},{"type":40,"tag":139,"props":8752,"children":8753},{"style":248},[8754],{"type":45,"value":2637},{"type":40,"tag":139,"props":8756,"children":8757},{"style":2640},[8758],{"type":45,"value":8759},"ctx",{"type":40,"tag":139,"props":8761,"children":8762},{"style":248},[8763],{"type":45,"value":383},{"type":40,"tag":139,"props":8765,"children":8766},{"style":299},[8767],{"type":45,"value":2661},{"type":40,"tag":139,"props":8769,"children":8770},{"style":254},[8771],{"type":45,"value":8772}," ctx",{"type":40,"tag":139,"props":8774,"children":8775},{"style":248},[8776],{"type":45,"value":356},{"type":40,"tag":139,"props":8778,"children":8779},{"style":254},[8780],{"type":45,"value":8781},"numberOfTurns ",{"type":40,"tag":139,"props":8783,"children":8784},{"style":248},[8785],{"type":45,"value":8786},">",{"type":40,"tag":139,"props":8788,"children":8789},{"style":3075},[8790],{"type":45,"value":8791}," 3",{"type":40,"tag":139,"props":8793,"children":8794},{"style":248},[8795],{"type":45,"value":8796}," ?",{"type":40,"tag":139,"props":8798,"children":8799},{"style":248},[8800],{"type":45,"value":272},{"type":40,"tag":139,"props":8802,"children":8803},{"style":162},[8804],{"type":45,"value":8805},"openai\u002Fgpt-4",{"type":40,"tag":139,"props":8807,"children":8808},{"style":248},[8809],{"type":45,"value":281},{"type":40,"tag":139,"props":8811,"children":8812},{"style":248},[8813],{"type":45,"value":8814}," :",{"type":40,"tag":139,"props":8816,"children":8817},{"style":248},[8818],{"type":45,"value":272},{"type":40,"tag":139,"props":8820,"children":8821},{"style":162},[8822],{"type":45,"value":8823},"openai\u002Fgpt-4o-mini",{"type":40,"tag":139,"props":8825,"children":8826},{"style":248},[8827],{"type":45,"value":281},{"type":40,"tag":139,"props":8829,"children":8830},{"style":248},[8831],{"type":45,"value":701},{"type":40,"tag":139,"props":8833,"children":8834},{"class":141,"line":173},[8835,8840,8844,8848,8852,8856,8860,8864,8868,8872,8876,8881,8885,8890,8894,8899],{"type":40,"tag":139,"props":8836,"children":8837},{"style":320},[8838],{"type":45,"value":8839},"  temperature",{"type":40,"tag":139,"props":8841,"children":8842},{"style":248},[8843],{"type":45,"value":346},{"type":40,"tag":139,"props":8845,"children":8846},{"style":248},[8847],{"type":45,"value":2637},{"type":40,"tag":139,"props":8849,"children":8850},{"style":2640},[8851],{"type":45,"value":8759},{"type":40,"tag":139,"props":8853,"children":8854},{"style":248},[8855],{"type":45,"value":383},{"type":40,"tag":139,"props":8857,"children":8858},{"style":299},[8859],{"type":45,"value":2661},{"type":40,"tag":139,"props":8861,"children":8862},{"style":254},[8863],{"type":45,"value":8772},{"type":40,"tag":139,"props":8865,"children":8866},{"style":248},[8867],{"type":45,"value":356},{"type":40,"tag":139,"props":8869,"children":8870},{"style":254},[8871],{"type":45,"value":8781},{"type":40,"tag":139,"props":8873,"children":8874},{"style":248},[8875],{"type":45,"value":8786},{"type":40,"tag":139,"props":8877,"children":8878},{"style":3075},[8879],{"type":45,"value":8880}," 1",{"type":40,"tag":139,"props":8882,"children":8883},{"style":248},[8884],{"type":45,"value":8796},{"type":40,"tag":139,"props":8886,"children":8887},{"style":3075},[8888],{"type":45,"value":8889}," 0.3",{"type":40,"tag":139,"props":8891,"children":8892},{"style":248},[8893],{"type":45,"value":8814},{"type":40,"tag":139,"props":8895,"children":8896},{"style":3075},[8897],{"type":45,"value":8898}," 0.7",{"type":40,"tag":139,"props":8900,"children":8901},{"style":248},[8902],{"type":45,"value":701},{"type":40,"tag":139,"props":8904,"children":8905},{"class":141,"line":183},[8906,8910,8914,8918,8922],{"type":40,"tag":139,"props":8907,"children":8908},{"style":338},[8909],{"type":45,"value":709},{"type":40,"tag":139,"props":8911,"children":8912},{"style":248},[8913],{"type":45,"value":346},{"type":40,"tag":139,"props":8915,"children":8916},{"style":248},[8917],{"type":45,"value":272},{"type":40,"tag":139,"props":8919,"children":8920},{"style":162},[8921],{"type":45,"value":722},{"type":40,"tag":139,"props":8923,"children":8924},{"style":248},[8925],{"type":45,"value":727},{"type":40,"tag":139,"props":8927,"children":8928},{"class":141,"line":192},[8929,8933,8937],{"type":40,"tag":139,"props":8930,"children":8931},{"style":248},[8932],{"type":45,"value":378},{"type":40,"tag":139,"props":8934,"children":8935},{"style":254},[8936],{"type":45,"value":383},{"type":40,"tag":139,"props":8938,"children":8939},{"style":248},[8940],{"type":45,"value":286},{"type":40,"tag":403,"props":8942,"children":8944},{"id":8943},"context-object-properties",[8945],{"type":45,"value":8946},"Context Object Properties",{"type":40,"tag":1801,"props":8948,"children":8949},{},[8950,8969],{"type":40,"tag":1805,"props":8951,"children":8952},{},[8953],{"type":40,"tag":1809,"props":8954,"children":8955},{},[8956,8961,8965],{"type":40,"tag":1813,"props":8957,"children":8958},{},[8959],{"type":45,"value":8960},"Property",{"type":40,"tag":1813,"props":8962,"children":8963},{},[8964],{"type":45,"value":1822},{"type":40,"tag":1813,"props":8966,"children":8967},{},[8968],{"type":45,"value":1832},{"type":40,"tag":1834,"props":8970,"children":8971},{},[8972,8993,9013,9033],{"type":40,"tag":1809,"props":8973,"children":8974},{},[8975,8984,8988],{"type":40,"tag":1841,"props":8976,"children":8977},{},[8978],{"type":40,"tag":54,"props":8979,"children":8981},{"className":8980},[],[8982],{"type":45,"value":8983},"numberOfTurns",{"type":40,"tag":1841,"props":8985,"children":8986},{},[8987],{"type":45,"value":6464},{"type":40,"tag":1841,"props":8989,"children":8990},{},[8991],{"type":45,"value":8992},"Current turn count",{"type":40,"tag":1809,"props":8994,"children":8995},{},[8996,9004,9008],{"type":40,"tag":1841,"props":8997,"children":8998},{},[8999],{"type":40,"tag":54,"props":9000,"children":9002},{"className":9001},[],[9003],{"type":45,"value":8505},{"type":40,"tag":1841,"props":9005,"children":9006},{},[9007],{"type":45,"value":7530},{"type":40,"tag":1841,"props":9009,"children":9010},{},[9011],{"type":45,"value":9012},"All messages so far",{"type":40,"tag":1809,"props":9014,"children":9015},{},[9016,9024,9028],{"type":40,"tag":1841,"props":9017,"children":9018},{},[9019],{"type":40,"tag":54,"props":9020,"children":9022},{"className":9021},[],[9023],{"type":45,"value":5056},{"type":40,"tag":1841,"props":9025,"children":9026},{},[9027],{"type":45,"value":1858},{"type":40,"tag":1841,"props":9029,"children":9030},{},[9031],{"type":45,"value":9032},"Current system instructions",{"type":40,"tag":1809,"props":9034,"children":9035},{},[9036,9045,9049],{"type":40,"tag":1841,"props":9037,"children":9038},{},[9039],{"type":40,"tag":54,"props":9040,"children":9042},{"className":9041},[],[9043],{"type":45,"value":9044},"totalCost",{"type":40,"tag":1841,"props":9046,"children":9047},{},[9048],{"type":45,"value":6464},{"type":40,"tag":1841,"props":9050,"children":9051},{},[9052],{"type":45,"value":9053},"Accumulated cost",{"type":40,"tag":117,"props":9055,"children":9056},{},[],{"type":40,"tag":121,"props":9058,"children":9060},{"id":9059},"nextturnparams-context-injection",[9061],{"type":45,"value":9062},"nextTurnParams: Context Injection",{"type":40,"tag":48,"props":9064,"children":9065},{},[9066],{"type":45,"value":9067},"Tools can modify parameters for subsequent turns, enabling skills and context-aware behavior:",{"type":40,"tag":128,"props":9069,"children":9071},{"className":231,"code":9070,"language":19,"meta":133,"style":133},"const skillTool = tool({\n  name: 'load_skill',\n  description: 'Load a specialized skill',\n  inputSchema: z.object({\n    skill: z.string().describe('Name of the skill to load')\n  }),\n  nextTurnParams: {\n    instructions: (params, context) => {\n      const skillInstructions = loadSkillInstructions(params.skill);\n      return `${context.instructions}\\n\\n${skillInstructions}`;\n    }\n  },\n  execute: async ({ skill }) => {\n    return { loaded: skill };\n  }\n});\n",[9072],{"type":40,"tag":54,"props":9073,"children":9074},{"__ignoreMap":133},[9075,9103,9131,9159,9190,9247,9262,9278,9318,9365,9418,9425,9433,9469,9497,9504],{"type":40,"tag":139,"props":9076,"children":9077},{"class":141,"line":142},[9078,9082,9087,9091,9095,9099],{"type":40,"tag":139,"props":9079,"children":9080},{"style":299},[9081],{"type":45,"value":302},{"type":40,"tag":139,"props":9083,"children":9084},{"style":254},[9085],{"type":45,"value":9086}," skillTool ",{"type":40,"tag":139,"props":9088,"children":9089},{"style":248},[9090],{"type":45,"value":312},{"type":40,"tag":139,"props":9092,"children":9093},{"style":320},[9094],{"type":45,"value":6031},{"type":40,"tag":139,"props":9096,"children":9097},{"style":254},[9098],{"type":45,"value":327},{"type":40,"tag":139,"props":9100,"children":9101},{"style":248},[9102],{"type":45,"value":332},{"type":40,"tag":139,"props":9104,"children":9105},{"class":141,"line":152},[9106,9110,9114,9118,9123,9127],{"type":40,"tag":139,"props":9107,"children":9108},{"style":338},[9109],{"type":45,"value":1193},{"type":40,"tag":139,"props":9111,"children":9112},{"style":248},[9113],{"type":45,"value":346},{"type":40,"tag":139,"props":9115,"children":9116},{"style":248},[9117],{"type":45,"value":272},{"type":40,"tag":139,"props":9119,"children":9120},{"style":162},[9121],{"type":45,"value":9122},"load_skill",{"type":40,"tag":139,"props":9124,"children":9125},{"style":248},[9126],{"type":45,"value":281},{"type":40,"tag":139,"props":9128,"children":9129},{"style":248},[9130],{"type":45,"value":701},{"type":40,"tag":139,"props":9132,"children":9133},{"class":141,"line":173},[9134,9138,9142,9146,9151,9155],{"type":40,"tag":139,"props":9135,"children":9136},{"style":338},[9137],{"type":45,"value":6168},{"type":40,"tag":139,"props":9139,"children":9140},{"style":248},[9141],{"type":45,"value":346},{"type":40,"tag":139,"props":9143,"children":9144},{"style":248},[9145],{"type":45,"value":272},{"type":40,"tag":139,"props":9147,"children":9148},{"style":162},[9149],{"type":45,"value":9150},"Load a specialized skill",{"type":40,"tag":139,"props":9152,"children":9153},{"style":248},[9154],{"type":45,"value":281},{"type":40,"tag":139,"props":9156,"children":9157},{"style":248},[9158],{"type":45,"value":701},{"type":40,"tag":139,"props":9160,"children":9161},{"class":141,"line":183},[9162,9166,9170,9174,9178,9182,9186],{"type":40,"tag":139,"props":9163,"children":9164},{"style":338},[9165],{"type":45,"value":6197},{"type":40,"tag":139,"props":9167,"children":9168},{"style":248},[9169],{"type":45,"value":346},{"type":40,"tag":139,"props":9171,"children":9172},{"style":254},[9173],{"type":45,"value":6072},{"type":40,"tag":139,"props":9175,"children":9176},{"style":248},[9177],{"type":45,"value":356},{"type":40,"tag":139,"props":9179,"children":9180},{"style":320},[9181],{"type":45,"value":6214},{"type":40,"tag":139,"props":9183,"children":9184},{"style":254},[9185],{"type":45,"value":327},{"type":40,"tag":139,"props":9187,"children":9188},{"style":248},[9189],{"type":45,"value":332},{"type":40,"tag":139,"props":9191,"children":9192},{"class":141,"line":192},[9193,9198,9202,9206,9210,9214,9218,9222,9226,9230,9234,9239,9243],{"type":40,"tag":139,"props":9194,"children":9195},{"style":338},[9196],{"type":45,"value":9197},"    skill",{"type":40,"tag":139,"props":9199,"children":9200},{"style":248},[9201],{"type":45,"value":346},{"type":40,"tag":139,"props":9203,"children":9204},{"style":254},[9205],{"type":45,"value":6072},{"type":40,"tag":139,"props":9207,"children":9208},{"style":248},[9209],{"type":45,"value":356},{"type":40,"tag":139,"props":9211,"children":9212},{"style":320},[9213],{"type":45,"value":1858},{"type":40,"tag":139,"props":9215,"children":9216},{"style":254},[9217],{"type":45,"value":931},{"type":40,"tag":139,"props":9219,"children":9220},{"style":248},[9221],{"type":45,"value":356},{"type":40,"tag":139,"props":9223,"children":9224},{"style":320},[9225],{"type":45,"value":6259},{"type":40,"tag":139,"props":9227,"children":9228},{"style":254},[9229],{"type":45,"value":327},{"type":40,"tag":139,"props":9231,"children":9232},{"style":248},[9233],{"type":45,"value":281},{"type":40,"tag":139,"props":9235,"children":9236},{"style":162},[9237],{"type":45,"value":9238},"Name of the skill to load",{"type":40,"tag":139,"props":9240,"children":9241},{"style":248},[9242],{"type":45,"value":281},{"type":40,"tag":139,"props":9244,"children":9245},{"style":254},[9246],{"type":45,"value":6392},{"type":40,"tag":139,"props":9248,"children":9249},{"class":141,"line":995},[9250,9254,9258],{"type":40,"tag":139,"props":9251,"children":9252},{"style":248},[9253],{"type":45,"value":2746},{"type":40,"tag":139,"props":9255,"children":9256},{"style":254},[9257],{"type":45,"value":383},{"type":40,"tag":139,"props":9259,"children":9260},{"style":248},[9261],{"type":45,"value":701},{"type":40,"tag":139,"props":9263,"children":9264},{"class":141,"line":1213},[9265,9270,9274],{"type":40,"tag":139,"props":9266,"children":9267},{"style":338},[9268],{"type":45,"value":9269},"  nextTurnParams",{"type":40,"tag":139,"props":9271,"children":9272},{"style":248},[9273],{"type":45,"value":346},{"type":40,"tag":139,"props":9275,"children":9276},{"style":248},[9277],{"type":45,"value":1436},{"type":40,"tag":139,"props":9279,"children":9280},{"class":141,"line":1229},[9281,9286,9290,9294,9298,9302,9306,9310,9314],{"type":40,"tag":139,"props":9282,"children":9283},{"style":320},[9284],{"type":45,"value":9285},"    instructions",{"type":40,"tag":139,"props":9287,"children":9288},{"style":248},[9289],{"type":45,"value":346},{"type":40,"tag":139,"props":9291,"children":9292},{"style":248},[9293],{"type":45,"value":2637},{"type":40,"tag":139,"props":9295,"children":9296},{"style":2640},[9297],{"type":45,"value":6573},{"type":40,"tag":139,"props":9299,"children":9300},{"style":248},[9301],{"type":45,"value":974},{"type":40,"tag":139,"props":9303,"children":9304},{"style":2640},[9305],{"type":45,"value":8496},{"type":40,"tag":139,"props":9307,"children":9308},{"style":248},[9309],{"type":45,"value":383},{"type":40,"tag":139,"props":9311,"children":9312},{"style":299},[9313],{"type":45,"value":2661},{"type":40,"tag":139,"props":9315,"children":9316},{"style":248},[9317],{"type":45,"value":1436},{"type":40,"tag":139,"props":9319,"children":9320},{"class":141,"line":1237},[9321,9326,9331,9335,9340,9344,9348,9352,9357,9361],{"type":40,"tag":139,"props":9322,"children":9323},{"style":299},[9324],{"type":45,"value":9325},"      const",{"type":40,"tag":139,"props":9327,"children":9328},{"style":254},[9329],{"type":45,"value":9330}," skillInstructions",{"type":40,"tag":139,"props":9332,"children":9333},{"style":248},[9334],{"type":45,"value":2682},{"type":40,"tag":139,"props":9336,"children":9337},{"style":320},[9338],{"type":45,"value":9339}," loadSkillInstructions",{"type":40,"tag":139,"props":9341,"children":9342},{"style":338},[9343],{"type":45,"value":327},{"type":40,"tag":139,"props":9345,"children":9346},{"style":254},[9347],{"type":45,"value":6573},{"type":40,"tag":139,"props":9349,"children":9350},{"style":248},[9351],{"type":45,"value":356},{"type":40,"tag":139,"props":9353,"children":9354},{"style":254},[9355],{"type":45,"value":9356},"skill",{"type":40,"tag":139,"props":9358,"children":9359},{"style":338},[9360],{"type":45,"value":383},{"type":40,"tag":139,"props":9362,"children":9363},{"style":248},[9364],{"type":45,"value":286},{"type":40,"tag":139,"props":9366,"children":9367},{"class":141,"line":1246},[9368,9373,9378,9382,9386,9390,9394,9399,9404,9409,9414],{"type":40,"tag":139,"props":9369,"children":9370},{"style":242},[9371],{"type":45,"value":9372},"      return",{"type":40,"tag":139,"props":9374,"children":9375},{"style":248},[9376],{"type":45,"value":9377}," `${",{"type":40,"tag":139,"props":9379,"children":9380},{"style":254},[9381],{"type":45,"value":8471},{"type":40,"tag":139,"props":9383,"children":9384},{"style":248},[9385],{"type":45,"value":356},{"type":40,"tag":139,"props":9387,"children":9388},{"style":254},[9389],{"type":45,"value":5056},{"type":40,"tag":139,"props":9391,"children":9392},{"style":248},[9393],{"type":45,"value":378},{"type":40,"tag":139,"props":9395,"children":9396},{"style":254},[9397],{"type":45,"value":9398},"\\n\\n",{"type":40,"tag":139,"props":9400,"children":9401},{"style":248},[9402],{"type":45,"value":9403},"${",{"type":40,"tag":139,"props":9405,"children":9406},{"style":254},[9407],{"type":45,"value":9408},"skillInstructions",{"type":40,"tag":139,"props":9410,"children":9411},{"style":248},[9412],{"type":45,"value":9413},"}`",{"type":40,"tag":139,"props":9415,"children":9416},{"style":248},[9417],{"type":45,"value":286},{"type":40,"tag":139,"props":9419,"children":9420},{"class":141,"line":1296},[9421],{"type":40,"tag":139,"props":9422,"children":9423},{"style":248},[9424],{"type":45,"value":5017},{"type":40,"tag":139,"props":9426,"children":9427},{"class":141,"line":1322},[9428],{"type":40,"tag":139,"props":9429,"children":9430},{"style":248},[9431],{"type":45,"value":9432},"  },\n",{"type":40,"tag":139,"props":9434,"children":9435},{"class":141,"line":1338},[9436,9440,9444,9448,9452,9457,9461,9465],{"type":40,"tag":139,"props":9437,"children":9438},{"style":320},[9439],{"type":45,"value":6556},{"type":40,"tag":139,"props":9441,"children":9442},{"style":248},[9443],{"type":45,"value":346},{"type":40,"tag":139,"props":9445,"children":9446},{"style":299},[9447],{"type":45,"value":2632},{"type":40,"tag":139,"props":9449,"children":9450},{"style":248},[9451],{"type":45,"value":7092},{"type":40,"tag":139,"props":9453,"children":9454},{"style":2640},[9455],{"type":45,"value":9456}," skill",{"type":40,"tag":139,"props":9458,"children":9459},{"style":248},[9460],{"type":45,"value":7102},{"type":40,"tag":139,"props":9462,"children":9463},{"style":299},[9464],{"type":45,"value":2661},{"type":40,"tag":139,"props":9466,"children":9467},{"style":248},[9468],{"type":45,"value":1436},{"type":40,"tag":139,"props":9470,"children":9471},{"class":141,"line":1346},[9472,9476,9480,9485,9489,9493],{"type":40,"tag":139,"props":9473,"children":9474},{"style":242},[9475],{"type":45,"value":3055},{"type":40,"tag":139,"props":9477,"children":9478},{"style":248},[9479],{"type":45,"value":251},{"type":40,"tag":139,"props":9481,"children":9482},{"style":338},[9483],{"type":45,"value":9484}," loaded",{"type":40,"tag":139,"props":9486,"children":9487},{"style":248},[9488],{"type":45,"value":346},{"type":40,"tag":139,"props":9490,"children":9491},{"style":254},[9492],{"type":45,"value":9456},{"type":40,"tag":139,"props":9494,"children":9495},{"style":248},[9496],{"type":45,"value":2813},{"type":40,"tag":139,"props":9498,"children":9499},{"class":141,"line":1355},[9500],{"type":40,"tag":139,"props":9501,"children":9502},{"style":248},[9503],{"type":45,"value":1471},{"type":40,"tag":139,"props":9505,"children":9506},{"class":141,"line":1393},[9507,9511,9515],{"type":40,"tag":139,"props":9508,"children":9509},{"style":248},[9510],{"type":45,"value":378},{"type":40,"tag":139,"props":9512,"children":9513},{"style":254},[9514],{"type":45,"value":383},{"type":40,"tag":139,"props":9516,"children":9517},{"style":248},[9518],{"type":45,"value":286},{"type":40,"tag":403,"props":9520,"children":9522},{"id":9521},"use-cases-for-nextturnparams",[9523],{"type":45,"value":9524},"Use Cases for nextTurnParams",{"type":40,"tag":68,"props":9526,"children":9527},{},[9528,9538,9548,9558],{"type":40,"tag":72,"props":9529,"children":9530},{},[9531,9536],{"type":40,"tag":76,"props":9532,"children":9533},{},[9534],{"type":45,"value":9535},"Skill Systems",{"type":45,"value":9537},": Dynamically load specialized capabilities",{"type":40,"tag":72,"props":9539,"children":9540},{},[9541,9546],{"type":40,"tag":76,"props":9542,"children":9543},{},[9544],{"type":45,"value":9545},"Context Accumulation",{"type":45,"value":9547},": Build up context over multiple turns",{"type":40,"tag":72,"props":9549,"children":9550},{},[9551,9556],{"type":40,"tag":76,"props":9552,"children":9553},{},[9554],{"type":45,"value":9555},"Mode Switching",{"type":45,"value":9557},": Change model behavior mid-conversation",{"type":40,"tag":72,"props":9559,"children":9560},{},[9561,9566],{"type":40,"tag":76,"props":9562,"children":9563},{},[9564],{"type":45,"value":9565},"Memory Injection",{"type":45,"value":9567},": Add retrieved context to instructions",{"type":40,"tag":117,"props":9569,"children":9570},{},[],{"type":40,"tag":121,"props":9572,"children":9574},{"id":9573},"generation-parameters",[9575],{"type":45,"value":9576},"Generation Parameters",{"type":40,"tag":48,"props":9578,"children":9579},{},[9580],{"type":45,"value":9581},"Control model behavior with these parameters:",{"type":40,"tag":128,"props":9583,"children":9585},{"className":231,"code":9584,"language":19,"meta":133,"style":133},"const result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Write a creative story',\n  temperature: 0.7,        \u002F\u002F Creativity (0-2, default varies by model)\n  maxOutputTokens: 1000,   \u002F\u002F Maximum tokens to generate\n  topP: 0.9,               \u002F\u002F Nucleus sampling parameter\n  frequencyPenalty: 0.5,   \u002F\u002F Reduce repetition\n  presencePenalty: 0.5,    \u002F\u002F Encourage new topics\n  stop: ['\\n\\n']           \u002F\u002F Stop sequences\n});\n",[9586],{"type":40,"tag":54,"props":9587,"children":9588},{"__ignoreMap":133},[9589,9624,9651,9679,9703,9729,9755,9781,9806,9844],{"type":40,"tag":139,"props":9590,"children":9591},{"class":141,"line":142},[9592,9596,9600,9604,9608,9612,9616,9620],{"type":40,"tag":139,"props":9593,"children":9594},{"style":299},[9595],{"type":45,"value":302},{"type":40,"tag":139,"props":9597,"children":9598},{"style":254},[9599],{"type":45,"value":646},{"type":40,"tag":139,"props":9601,"children":9602},{"style":248},[9603],{"type":45,"value":312},{"type":40,"tag":139,"props":9605,"children":9606},{"style":254},[9607],{"type":45,"value":655},{"type":40,"tag":139,"props":9609,"children":9610},{"style":248},[9611],{"type":45,"value":356},{"type":40,"tag":139,"props":9613,"children":9614},{"style":320},[9615],{"type":45,"value":59},{"type":40,"tag":139,"props":9617,"children":9618},{"style":254},[9619],{"type":45,"value":327},{"type":40,"tag":139,"props":9621,"children":9622},{"style":248},[9623],{"type":45,"value":332},{"type":40,"tag":139,"props":9625,"children":9626},{"class":141,"line":152},[9627,9631,9635,9639,9643,9647],{"type":40,"tag":139,"props":9628,"children":9629},{"style":338},[9630],{"type":45,"value":679},{"type":40,"tag":139,"props":9632,"children":9633},{"style":248},[9634],{"type":45,"value":346},{"type":40,"tag":139,"props":9636,"children":9637},{"style":248},[9638],{"type":45,"value":272},{"type":40,"tag":139,"props":9640,"children":9641},{"style":162},[9642],{"type":45,"value":692},{"type":40,"tag":139,"props":9644,"children":9645},{"style":248},[9646],{"type":45,"value":281},{"type":40,"tag":139,"props":9648,"children":9649},{"style":248},[9650],{"type":45,"value":701},{"type":40,"tag":139,"props":9652,"children":9653},{"class":141,"line":173},[9654,9658,9662,9666,9671,9675],{"type":40,"tag":139,"props":9655,"children":9656},{"style":338},[9657],{"type":45,"value":709},{"type":40,"tag":139,"props":9659,"children":9660},{"style":248},[9661],{"type":45,"value":346},{"type":40,"tag":139,"props":9663,"children":9664},{"style":248},[9665],{"type":45,"value":272},{"type":40,"tag":139,"props":9667,"children":9668},{"style":162},[9669],{"type":45,"value":9670},"Write a creative story",{"type":40,"tag":139,"props":9672,"children":9673},{"style":248},[9674],{"type":45,"value":281},{"type":40,"tag":139,"props":9676,"children":9677},{"style":248},[9678],{"type":45,"value":701},{"type":40,"tag":139,"props":9680,"children":9681},{"class":141,"line":183},[9682,9686,9690,9694,9698],{"type":40,"tag":139,"props":9683,"children":9684},{"style":338},[9685],{"type":45,"value":8839},{"type":40,"tag":139,"props":9687,"children":9688},{"style":248},[9689],{"type":45,"value":346},{"type":40,"tag":139,"props":9691,"children":9692},{"style":3075},[9693],{"type":45,"value":8898},{"type":40,"tag":139,"props":9695,"children":9696},{"style":248},[9697],{"type":45,"value":974},{"type":40,"tag":139,"props":9699,"children":9700},{"style":146},[9701],{"type":45,"value":9702},"        \u002F\u002F Creativity (0-2, default varies by model)\n",{"type":40,"tag":139,"props":9704,"children":9705},{"class":141,"line":192},[9706,9711,9715,9720,9724],{"type":40,"tag":139,"props":9707,"children":9708},{"style":338},[9709],{"type":45,"value":9710},"  maxOutputTokens",{"type":40,"tag":139,"props":9712,"children":9713},{"style":248},[9714],{"type":45,"value":346},{"type":40,"tag":139,"props":9716,"children":9717},{"style":3075},[9718],{"type":45,"value":9719}," 1000",{"type":40,"tag":139,"props":9721,"children":9722},{"style":248},[9723],{"type":45,"value":974},{"type":40,"tag":139,"props":9725,"children":9726},{"style":146},[9727],{"type":45,"value":9728},"   \u002F\u002F Maximum tokens to generate\n",{"type":40,"tag":139,"props":9730,"children":9731},{"class":141,"line":995},[9732,9737,9741,9746,9750],{"type":40,"tag":139,"props":9733,"children":9734},{"style":338},[9735],{"type":45,"value":9736},"  topP",{"type":40,"tag":139,"props":9738,"children":9739},{"style":248},[9740],{"type":45,"value":346},{"type":40,"tag":139,"props":9742,"children":9743},{"style":3075},[9744],{"type":45,"value":9745}," 0.9",{"type":40,"tag":139,"props":9747,"children":9748},{"style":248},[9749],{"type":45,"value":974},{"type":40,"tag":139,"props":9751,"children":9752},{"style":146},[9753],{"type":45,"value":9754},"               \u002F\u002F Nucleus sampling parameter\n",{"type":40,"tag":139,"props":9756,"children":9757},{"class":141,"line":1213},[9758,9763,9767,9772,9776],{"type":40,"tag":139,"props":9759,"children":9760},{"style":338},[9761],{"type":45,"value":9762},"  frequencyPenalty",{"type":40,"tag":139,"props":9764,"children":9765},{"style":248},[9766],{"type":45,"value":346},{"type":40,"tag":139,"props":9768,"children":9769},{"style":3075},[9770],{"type":45,"value":9771}," 0.5",{"type":40,"tag":139,"props":9773,"children":9774},{"style":248},[9775],{"type":45,"value":974},{"type":40,"tag":139,"props":9777,"children":9778},{"style":146},[9779],{"type":45,"value":9780},"   \u002F\u002F Reduce repetition\n",{"type":40,"tag":139,"props":9782,"children":9783},{"class":141,"line":1229},[9784,9789,9793,9797,9801],{"type":40,"tag":139,"props":9785,"children":9786},{"style":338},[9787],{"type":45,"value":9788},"  presencePenalty",{"type":40,"tag":139,"props":9790,"children":9791},{"style":248},[9792],{"type":45,"value":346},{"type":40,"tag":139,"props":9794,"children":9795},{"style":3075},[9796],{"type":45,"value":9771},{"type":40,"tag":139,"props":9798,"children":9799},{"style":248},[9800],{"type":45,"value":974},{"type":40,"tag":139,"props":9802,"children":9803},{"style":146},[9804],{"type":45,"value":9805},"    \u002F\u002F Encourage new topics\n",{"type":40,"tag":139,"props":9807,"children":9808},{"class":141,"line":1237},[9809,9814,9818,9822,9826,9830,9834,9839],{"type":40,"tag":139,"props":9810,"children":9811},{"style":338},[9812],{"type":45,"value":9813},"  stop",{"type":40,"tag":139,"props":9815,"children":9816},{"style":248},[9817],{"type":45,"value":346},{"type":40,"tag":139,"props":9819,"children":9820},{"style":254},[9821],{"type":45,"value":7746},{"type":40,"tag":139,"props":9823,"children":9824},{"style":248},[9825],{"type":45,"value":281},{"type":40,"tag":139,"props":9827,"children":9828},{"style":254},[9829],{"type":45,"value":9398},{"type":40,"tag":139,"props":9831,"children":9832},{"style":248},[9833],{"type":45,"value":281},{"type":40,"tag":139,"props":9835,"children":9836},{"style":254},[9837],{"type":45,"value":9838},"]           ",{"type":40,"tag":139,"props":9840,"children":9841},{"style":146},[9842],{"type":45,"value":9843},"\u002F\u002F Stop sequences\n",{"type":40,"tag":139,"props":9845,"children":9846},{"class":141,"line":1246},[9847,9851,9855],{"type":40,"tag":139,"props":9848,"children":9849},{"style":248},[9850],{"type":45,"value":378},{"type":40,"tag":139,"props":9852,"children":9853},{"style":254},[9854],{"type":45,"value":383},{"type":40,"tag":139,"props":9856,"children":9857},{"style":248},[9858],{"type":45,"value":286},{"type":40,"tag":117,"props":9860,"children":9861},{},[],{"type":40,"tag":121,"props":9863,"children":9865},{"id":9864},"streaming",[9866],{"type":45,"value":9867},"Streaming",{"type":40,"tag":48,"props":9869,"children":9870},{},[9871],{"type":45,"value":9872},"All streaming methods support concurrent consumers from a single result object:",{"type":40,"tag":128,"props":9874,"children":9876},{"className":231,"code":9875,"language":19,"meta":133,"style":133},"const result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Write a detailed explanation'\n});\n\n\u002F\u002F Consumer 1: Stream text to console\nconst textPromise = (async () => {\n  for await (const delta of result.getTextStream()) {\n    process.stdout.write(delta);\n  }\n})();\n\n\u002F\u002F Consumer 2: Get full response simultaneously\nconst responsePromise = result.getResponse();\n\n\u002F\u002F Both run concurrently\nconst [, response] = await Promise.all([textPromise, responsePromise]);\nconsole.log('\\n\\nTotal tokens:', response.usage.totalTokens);\n",[9877],{"type":40,"tag":54,"props":9878,"children":9879},{"__ignoreMap":133},[9880,9915,9942,9966,9981,9988,9996,10034,10084,10124,10131,10147,10154,10162,10198,10205,10213,10274],{"type":40,"tag":139,"props":9881,"children":9882},{"class":141,"line":142},[9883,9887,9891,9895,9899,9903,9907,9911],{"type":40,"tag":139,"props":9884,"children":9885},{"style":299},[9886],{"type":45,"value":302},{"type":40,"tag":139,"props":9888,"children":9889},{"style":254},[9890],{"type":45,"value":646},{"type":40,"tag":139,"props":9892,"children":9893},{"style":248},[9894],{"type":45,"value":312},{"type":40,"tag":139,"props":9896,"children":9897},{"style":254},[9898],{"type":45,"value":655},{"type":40,"tag":139,"props":9900,"children":9901},{"style":248},[9902],{"type":45,"value":356},{"type":40,"tag":139,"props":9904,"children":9905},{"style":320},[9906],{"type":45,"value":59},{"type":40,"tag":139,"props":9908,"children":9909},{"style":254},[9910],{"type":45,"value":327},{"type":40,"tag":139,"props":9912,"children":9913},{"style":248},[9914],{"type":45,"value":332},{"type":40,"tag":139,"props":9916,"children":9917},{"class":141,"line":152},[9918,9922,9926,9930,9934,9938],{"type":40,"tag":139,"props":9919,"children":9920},{"style":338},[9921],{"type":45,"value":679},{"type":40,"tag":139,"props":9923,"children":9924},{"style":248},[9925],{"type":45,"value":346},{"type":40,"tag":139,"props":9927,"children":9928},{"style":248},[9929],{"type":45,"value":272},{"type":40,"tag":139,"props":9931,"children":9932},{"style":162},[9933],{"type":45,"value":692},{"type":40,"tag":139,"props":9935,"children":9936},{"style":248},[9937],{"type":45,"value":281},{"type":40,"tag":139,"props":9939,"children":9940},{"style":248},[9941],{"type":45,"value":701},{"type":40,"tag":139,"props":9943,"children":9944},{"class":141,"line":173},[9945,9949,9953,9957,9962],{"type":40,"tag":139,"props":9946,"children":9947},{"style":338},[9948],{"type":45,"value":709},{"type":40,"tag":139,"props":9950,"children":9951},{"style":248},[9952],{"type":45,"value":346},{"type":40,"tag":139,"props":9954,"children":9955},{"style":248},[9956],{"type":45,"value":272},{"type":40,"tag":139,"props":9958,"children":9959},{"style":162},[9960],{"type":45,"value":9961},"Write a detailed explanation",{"type":40,"tag":139,"props":9963,"children":9964},{"style":248},[9965],{"type":45,"value":727},{"type":40,"tag":139,"props":9967,"children":9968},{"class":141,"line":183},[9969,9973,9977],{"type":40,"tag":139,"props":9970,"children":9971},{"style":248},[9972],{"type":45,"value":378},{"type":40,"tag":139,"props":9974,"children":9975},{"style":254},[9976],{"type":45,"value":383},{"type":40,"tag":139,"props":9978,"children":9979},{"style":248},[9980],{"type":45,"value":286},{"type":40,"tag":139,"props":9982,"children":9983},{"class":141,"line":192},[9984],{"type":40,"tag":139,"props":9985,"children":9986},{"emptyLinePlaceholder":177},[9987],{"type":45,"value":180},{"type":40,"tag":139,"props":9989,"children":9990},{"class":141,"line":995},[9991],{"type":40,"tag":139,"props":9992,"children":9993},{"style":146},[9994],{"type":45,"value":9995},"\u002F\u002F Consumer 1: Stream text to console\n",{"type":40,"tag":139,"props":9997,"children":9998},{"class":141,"line":1213},[9999,10003,10008,10012,10016,10021,10026,10030],{"type":40,"tag":139,"props":10000,"children":10001},{"style":299},[10002],{"type":45,"value":302},{"type":40,"tag":139,"props":10004,"children":10005},{"style":254},[10006],{"type":45,"value":10007}," textPromise ",{"type":40,"tag":139,"props":10009,"children":10010},{"style":248},[10011],{"type":45,"value":312},{"type":40,"tag":139,"props":10013,"children":10014},{"style":254},[10015],{"type":45,"value":2637},{"type":40,"tag":139,"props":10017,"children":10018},{"style":299},[10019],{"type":45,"value":10020},"async",{"type":40,"tag":139,"props":10022,"children":10023},{"style":248},[10024],{"type":45,"value":10025}," ()",{"type":40,"tag":139,"props":10027,"children":10028},{"style":299},[10029],{"type":45,"value":2661},{"type":40,"tag":139,"props":10031,"children":10032},{"style":248},[10033],{"type":45,"value":1436},{"type":40,"tag":139,"props":10035,"children":10036},{"class":141,"line":1229},[10037,10042,10046,10050,10054,10059,10064,10068,10072,10076,10080],{"type":40,"tag":139,"props":10038,"children":10039},{"style":242},[10040],{"type":45,"value":10041},"  for",{"type":40,"tag":139,"props":10043,"children":10044},{"style":242},[10045],{"type":45,"value":903},{"type":40,"tag":139,"props":10047,"children":10048},{"style":338},[10049],{"type":45,"value":2637},{"type":40,"tag":139,"props":10051,"children":10052},{"style":299},[10053],{"type":45,"value":302},{"type":40,"tag":139,"props":10055,"children":10056},{"style":254},[10057],{"type":45,"value":10058}," delta",{"type":40,"tag":139,"props":10060,"children":10061},{"style":248},[10062],{"type":45,"value":10063}," of",{"type":40,"tag":139,"props":10065,"children":10066},{"style":254},[10067],{"type":45,"value":3762},{"type":40,"tag":139,"props":10069,"children":10070},{"style":248},[10071],{"type":45,"value":356},{"type":40,"tag":139,"props":10073,"children":10074},{"style":320},[10075],{"type":45,"value":5928},{"type":40,"tag":139,"props":10077,"children":10078},{"style":338},[10079],{"type":45,"value":5933},{"type":40,"tag":139,"props":10081,"children":10082},{"style":248},[10083],{"type":45,"value":332},{"type":40,"tag":139,"props":10085,"children":10086},{"class":141,"line":1237},[10087,10092,10096,10100,10104,10108,10112,10116,10120],{"type":40,"tag":139,"props":10088,"children":10089},{"style":254},[10090],{"type":45,"value":10091},"    process",{"type":40,"tag":139,"props":10093,"children":10094},{"style":248},[10095],{"type":45,"value":356},{"type":40,"tag":139,"props":10097,"children":10098},{"style":254},[10099],{"type":45,"value":5954},{"type":40,"tag":139,"props":10101,"children":10102},{"style":248},[10103],{"type":45,"value":356},{"type":40,"tag":139,"props":10105,"children":10106},{"style":320},[10107],{"type":45,"value":5963},{"type":40,"tag":139,"props":10109,"children":10110},{"style":338},[10111],{"type":45,"value":327},{"type":40,"tag":139,"props":10113,"children":10114},{"style":254},[10115],{"type":45,"value":5972},{"type":40,"tag":139,"props":10117,"children":10118},{"style":338},[10119],{"type":45,"value":383},{"type":40,"tag":139,"props":10121,"children":10122},{"style":248},[10123],{"type":45,"value":286},{"type":40,"tag":139,"props":10125,"children":10126},{"class":141,"line":1246},[10127],{"type":40,"tag":139,"props":10128,"children":10129},{"style":248},[10130],{"type":45,"value":1471},{"type":40,"tag":139,"props":10132,"children":10133},{"class":141,"line":1296},[10134,10138,10143],{"type":40,"tag":139,"props":10135,"children":10136},{"style":248},[10137],{"type":45,"value":378},{"type":40,"tag":139,"props":10139,"children":10140},{"style":254},[10141],{"type":45,"value":10142},")()",{"type":40,"tag":139,"props":10144,"children":10145},{"style":248},[10146],{"type":45,"value":286},{"type":40,"tag":139,"props":10148,"children":10149},{"class":141,"line":1322},[10150],{"type":40,"tag":139,"props":10151,"children":10152},{"emptyLinePlaceholder":177},[10153],{"type":45,"value":180},{"type":40,"tag":139,"props":10155,"children":10156},{"class":141,"line":1338},[10157],{"type":40,"tag":139,"props":10158,"children":10159},{"style":146},[10160],{"type":45,"value":10161},"\u002F\u002F Consumer 2: Get full response simultaneously\n",{"type":40,"tag":139,"props":10163,"children":10164},{"class":141,"line":1346},[10165,10169,10174,10178,10182,10186,10190,10194],{"type":40,"tag":139,"props":10166,"children":10167},{"style":299},[10168],{"type":45,"value":302},{"type":40,"tag":139,"props":10170,"children":10171},{"style":254},[10172],{"type":45,"value":10173}," responsePromise ",{"type":40,"tag":139,"props":10175,"children":10176},{"style":248},[10177],{"type":45,"value":312},{"type":40,"tag":139,"props":10179,"children":10180},{"style":254},[10181],{"type":45,"value":3762},{"type":40,"tag":139,"props":10183,"children":10184},{"style":248},[10185],{"type":45,"value":356},{"type":40,"tag":139,"props":10187,"children":10188},{"style":320},[10189],{"type":45,"value":5651},{"type":40,"tag":139,"props":10191,"children":10192},{"style":254},[10193],{"type":45,"value":931},{"type":40,"tag":139,"props":10195,"children":10196},{"style":248},[10197],{"type":45,"value":286},{"type":40,"tag":139,"props":10199,"children":10200},{"class":141,"line":1355},[10201],{"type":40,"tag":139,"props":10202,"children":10203},{"emptyLinePlaceholder":177},[10204],{"type":45,"value":180},{"type":40,"tag":139,"props":10206,"children":10207},{"class":141,"line":1393},[10208],{"type":40,"tag":139,"props":10209,"children":10210},{"style":146},[10211],{"type":45,"value":10212},"\u002F\u002F Both run concurrently\n",{"type":40,"tag":139,"props":10214,"children":10215},{"class":141,"line":1421},[10216,10220,10225,10229,10234,10238,10242,10247,10251,10256,10261,10265,10270],{"type":40,"tag":139,"props":10217,"children":10218},{"style":299},[10219],{"type":45,"value":302},{"type":40,"tag":139,"props":10221,"children":10222},{"style":248},[10223],{"type":45,"value":10224}," [,",{"type":40,"tag":139,"props":10226,"children":10227},{"style":254},[10228],{"type":45,"value":3946},{"type":40,"tag":139,"props":10230,"children":10231},{"style":248},[10232],{"type":45,"value":10233},"]",{"type":40,"tag":139,"props":10235,"children":10236},{"style":248},[10237],{"type":45,"value":2682},{"type":40,"tag":139,"props":10239,"children":10240},{"style":242},[10241],{"type":45,"value":903},{"type":40,"tag":139,"props":10243,"children":10244},{"style":156},[10245],{"type":45,"value":10246}," Promise",{"type":40,"tag":139,"props":10248,"children":10249},{"style":248},[10250],{"type":45,"value":356},{"type":40,"tag":139,"props":10252,"children":10253},{"style":320},[10254],{"type":45,"value":10255},"all",{"type":40,"tag":139,"props":10257,"children":10258},{"style":254},[10259],{"type":45,"value":10260},"([textPromise",{"type":40,"tag":139,"props":10262,"children":10263},{"style":248},[10264],{"type":45,"value":974},{"type":40,"tag":139,"props":10266,"children":10267},{"style":254},[10268],{"type":45,"value":10269}," responsePromise])",{"type":40,"tag":139,"props":10271,"children":10272},{"style":248},[10273],{"type":45,"value":286},{"type":40,"tag":139,"props":10275,"children":10276},{"class":141,"line":1439},[10277,10281,10285,10289,10293,10297,10301,10306,10310,10314,10318,10322,10327,10331,10336],{"type":40,"tag":139,"props":10278,"children":10279},{"style":254},[10280],{"type":45,"value":943},{"type":40,"tag":139,"props":10282,"children":10283},{"style":248},[10284],{"type":45,"value":356},{"type":40,"tag":139,"props":10286,"children":10287},{"style":320},[10288],{"type":45,"value":952},{"type":40,"tag":139,"props":10290,"children":10291},{"style":254},[10292],{"type":45,"value":327},{"type":40,"tag":139,"props":10294,"children":10295},{"style":248},[10296],{"type":45,"value":281},{"type":40,"tag":139,"props":10298,"children":10299},{"style":254},[10300],{"type":45,"value":9398},{"type":40,"tag":139,"props":10302,"children":10303},{"style":162},[10304],{"type":45,"value":10305},"Total tokens:",{"type":40,"tag":139,"props":10307,"children":10308},{"style":248},[10309],{"type":45,"value":281},{"type":40,"tag":139,"props":10311,"children":10312},{"style":248},[10313],{"type":45,"value":974},{"type":40,"tag":139,"props":10315,"children":10316},{"style":254},[10317],{"type":45,"value":3946},{"type":40,"tag":139,"props":10319,"children":10320},{"style":248},[10321],{"type":45,"value":356},{"type":40,"tag":139,"props":10323,"children":10324},{"style":254},[10325],{"type":45,"value":10326},"usage",{"type":40,"tag":139,"props":10328,"children":10329},{"style":248},[10330],{"type":45,"value":356},{"type":40,"tag":139,"props":10332,"children":10333},{"style":254},[10334],{"type":45,"value":10335},"totalTokens)",{"type":40,"tag":139,"props":10337,"children":10338},{"style":248},[10339],{"type":45,"value":286},{"type":40,"tag":403,"props":10341,"children":10343},{"id":10342},"streaming-tool-calls",[10344],{"type":45,"value":10345},"Streaming Tool Calls",{"type":40,"tag":128,"props":10347,"children":10349},{"className":231,"code":10348,"language":19,"meta":133,"style":133},"const result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Search for information about TypeScript',\n  tools: [searchTool]\n});\n\nfor await (const toolCall of result.getToolCallsStream()) {\n  console.log(`Tool called: ${toolCall.name}`);\n  console.log(`Arguments: ${JSON.stringify(toolCall.arguments)}`);\n  console.log(`Result: ${JSON.stringify(toolCall.result)}`);\n}\n",[10350],{"type":40,"tag":54,"props":10351,"children":10352},{"__ignoreMap":133},[10353,10388,10415,10443,10459,10474,10481,10530,10590,10662,10731],{"type":40,"tag":139,"props":10354,"children":10355},{"class":141,"line":142},[10356,10360,10364,10368,10372,10376,10380,10384],{"type":40,"tag":139,"props":10357,"children":10358},{"style":299},[10359],{"type":45,"value":302},{"type":40,"tag":139,"props":10361,"children":10362},{"style":254},[10363],{"type":45,"value":646},{"type":40,"tag":139,"props":10365,"children":10366},{"style":248},[10367],{"type":45,"value":312},{"type":40,"tag":139,"props":10369,"children":10370},{"style":254},[10371],{"type":45,"value":655},{"type":40,"tag":139,"props":10373,"children":10374},{"style":248},[10375],{"type":45,"value":356},{"type":40,"tag":139,"props":10377,"children":10378},{"style":320},[10379],{"type":45,"value":59},{"type":40,"tag":139,"props":10381,"children":10382},{"style":254},[10383],{"type":45,"value":327},{"type":40,"tag":139,"props":10385,"children":10386},{"style":248},[10387],{"type":45,"value":332},{"type":40,"tag":139,"props":10389,"children":10390},{"class":141,"line":152},[10391,10395,10399,10403,10407,10411],{"type":40,"tag":139,"props":10392,"children":10393},{"style":338},[10394],{"type":45,"value":679},{"type":40,"tag":139,"props":10396,"children":10397},{"style":248},[10398],{"type":45,"value":346},{"type":40,"tag":139,"props":10400,"children":10401},{"style":248},[10402],{"type":45,"value":272},{"type":40,"tag":139,"props":10404,"children":10405},{"style":162},[10406],{"type":45,"value":692},{"type":40,"tag":139,"props":10408,"children":10409},{"style":248},[10410],{"type":45,"value":281},{"type":40,"tag":139,"props":10412,"children":10413},{"style":248},[10414],{"type":45,"value":701},{"type":40,"tag":139,"props":10416,"children":10417},{"class":141,"line":173},[10418,10422,10426,10430,10435,10439],{"type":40,"tag":139,"props":10419,"children":10420},{"style":338},[10421],{"type":45,"value":709},{"type":40,"tag":139,"props":10423,"children":10424},{"style":248},[10425],{"type":45,"value":346},{"type":40,"tag":139,"props":10427,"children":10428},{"style":248},[10429],{"type":45,"value":272},{"type":40,"tag":139,"props":10431,"children":10432},{"style":162},[10433],{"type":45,"value":10434},"Search for information about TypeScript",{"type":40,"tag":139,"props":10436,"children":10437},{"style":248},[10438],{"type":45,"value":281},{"type":40,"tag":139,"props":10440,"children":10441},{"style":248},[10442],{"type":45,"value":701},{"type":40,"tag":139,"props":10444,"children":10445},{"class":141,"line":183},[10446,10450,10454],{"type":40,"tag":139,"props":10447,"children":10448},{"style":338},[10449],{"type":45,"value":6812},{"type":40,"tag":139,"props":10451,"children":10452},{"style":248},[10453],{"type":45,"value":346},{"type":40,"tag":139,"props":10455,"children":10456},{"style":254},[10457],{"type":45,"value":10458}," [searchTool]\n",{"type":40,"tag":139,"props":10460,"children":10461},{"class":141,"line":192},[10462,10466,10470],{"type":40,"tag":139,"props":10463,"children":10464},{"style":248},[10465],{"type":45,"value":378},{"type":40,"tag":139,"props":10467,"children":10468},{"style":254},[10469],{"type":45,"value":383},{"type":40,"tag":139,"props":10471,"children":10472},{"style":248},[10473],{"type":45,"value":286},{"type":40,"tag":139,"props":10475,"children":10476},{"class":141,"line":995},[10477],{"type":40,"tag":139,"props":10478,"children":10479},{"emptyLinePlaceholder":177},[10480],{"type":45,"value":180},{"type":40,"tag":139,"props":10482,"children":10483},{"class":141,"line":1213},[10484,10488,10492,10496,10500,10505,10509,10513,10517,10522,10526],{"type":40,"tag":139,"props":10485,"children":10486},{"style":242},[10487],{"type":45,"value":5893},{"type":40,"tag":139,"props":10489,"children":10490},{"style":242},[10491],{"type":45,"value":903},{"type":40,"tag":139,"props":10493,"children":10494},{"style":254},[10495],{"type":45,"value":2637},{"type":40,"tag":139,"props":10497,"children":10498},{"style":299},[10499],{"type":45,"value":302},{"type":40,"tag":139,"props":10501,"children":10502},{"style":254},[10503],{"type":45,"value":10504}," toolCall ",{"type":40,"tag":139,"props":10506,"children":10507},{"style":248},[10508],{"type":45,"value":5915},{"type":40,"tag":139,"props":10510,"children":10511},{"style":254},[10512],{"type":45,"value":3762},{"type":40,"tag":139,"props":10514,"children":10515},{"style":248},[10516],{"type":45,"value":356},{"type":40,"tag":139,"props":10518,"children":10519},{"style":320},[10520],{"type":45,"value":10521},"getToolCallsStream",{"type":40,"tag":139,"props":10523,"children":10524},{"style":254},[10525],{"type":45,"value":5933},{"type":40,"tag":139,"props":10527,"children":10528},{"style":248},[10529],{"type":45,"value":332},{"type":40,"tag":139,"props":10531,"children":10532},{"class":141,"line":1229},[10533,10538,10542,10546,10550,10555,10560,10564,10569,10573,10578,10582,10586],{"type":40,"tag":139,"props":10534,"children":10535},{"style":254},[10536],{"type":45,"value":10537},"  console",{"type":40,"tag":139,"props":10539,"children":10540},{"style":248},[10541],{"type":45,"value":356},{"type":40,"tag":139,"props":10543,"children":10544},{"style":320},[10545],{"type":45,"value":952},{"type":40,"tag":139,"props":10547,"children":10548},{"style":338},[10549],{"type":45,"value":327},{"type":40,"tag":139,"props":10551,"children":10552},{"style":248},[10553],{"type":45,"value":10554},"`",{"type":40,"tag":139,"props":10556,"children":10557},{"style":162},[10558],{"type":45,"value":10559},"Tool called: ",{"type":40,"tag":139,"props":10561,"children":10562},{"style":248},[10563],{"type":45,"value":9403},{"type":40,"tag":139,"props":10565,"children":10566},{"style":254},[10567],{"type":45,"value":10568},"toolCall",{"type":40,"tag":139,"props":10570,"children":10571},{"style":248},[10572],{"type":45,"value":356},{"type":40,"tag":139,"props":10574,"children":10575},{"style":254},[10576],{"type":45,"value":10577},"name",{"type":40,"tag":139,"props":10579,"children":10580},{"style":248},[10581],{"type":45,"value":9413},{"type":40,"tag":139,"props":10583,"children":10584},{"style":338},[10585],{"type":45,"value":383},{"type":40,"tag":139,"props":10587,"children":10588},{"style":248},[10589],{"type":45,"value":286},{"type":40,"tag":139,"props":10591,"children":10592},{"class":141,"line":1237},[10593,10597,10601,10605,10609,10613,10618,10622,10627,10631,10636,10641,10645,10650,10654,10658],{"type":40,"tag":139,"props":10594,"children":10595},{"style":254},[10596],{"type":45,"value":10537},{"type":40,"tag":139,"props":10598,"children":10599},{"style":248},[10600],{"type":45,"value":356},{"type":40,"tag":139,"props":10602,"children":10603},{"style":320},[10604],{"type":45,"value":952},{"type":40,"tag":139,"props":10606,"children":10607},{"style":338},[10608],{"type":45,"value":327},{"type":40,"tag":139,"props":10610,"children":10611},{"style":248},[10612],{"type":45,"value":10554},{"type":40,"tag":139,"props":10614,"children":10615},{"style":162},[10616],{"type":45,"value":10617},"Arguments: ",{"type":40,"tag":139,"props":10619,"children":10620},{"style":248},[10621],{"type":45,"value":9403},{"type":40,"tag":139,"props":10623,"children":10624},{"style":254},[10625],{"type":45,"value":10626},"JSON",{"type":40,"tag":139,"props":10628,"children":10629},{"style":248},[10630],{"type":45,"value":356},{"type":40,"tag":139,"props":10632,"children":10633},{"style":320},[10634],{"type":45,"value":10635},"stringify",{"type":40,"tag":139,"props":10637,"children":10638},{"style":254},[10639],{"type":45,"value":10640},"(toolCall",{"type":40,"tag":139,"props":10642,"children":10643},{"style":248},[10644],{"type":45,"value":356},{"type":40,"tag":139,"props":10646,"children":10647},{"style":254},[10648],{"type":45,"value":10649},"arguments)",{"type":40,"tag":139,"props":10651,"children":10652},{"style":248},[10653],{"type":45,"value":9413},{"type":40,"tag":139,"props":10655,"children":10656},{"style":338},[10657],{"type":45,"value":383},{"type":40,"tag":139,"props":10659,"children":10660},{"style":248},[10661],{"type":45,"value":286},{"type":40,"tag":139,"props":10663,"children":10664},{"class":141,"line":1246},[10665,10669,10673,10677,10681,10685,10690,10694,10698,10702,10706,10710,10714,10719,10723,10727],{"type":40,"tag":139,"props":10666,"children":10667},{"style":254},[10668],{"type":45,"value":10537},{"type":40,"tag":139,"props":10670,"children":10671},{"style":248},[10672],{"type":45,"value":356},{"type":40,"tag":139,"props":10674,"children":10675},{"style":320},[10676],{"type":45,"value":952},{"type":40,"tag":139,"props":10678,"children":10679},{"style":338},[10680],{"type":45,"value":327},{"type":40,"tag":139,"props":10682,"children":10683},{"style":248},[10684],{"type":45,"value":10554},{"type":40,"tag":139,"props":10686,"children":10687},{"style":162},[10688],{"type":45,"value":10689},"Result: ",{"type":40,"tag":139,"props":10691,"children":10692},{"style":248},[10693],{"type":45,"value":9403},{"type":40,"tag":139,"props":10695,"children":10696},{"style":254},[10697],{"type":45,"value":10626},{"type":40,"tag":139,"props":10699,"children":10700},{"style":248},[10701],{"type":45,"value":356},{"type":40,"tag":139,"props":10703,"children":10704},{"style":320},[10705],{"type":45,"value":10635},{"type":40,"tag":139,"props":10707,"children":10708},{"style":254},[10709],{"type":45,"value":10640},{"type":40,"tag":139,"props":10711,"children":10712},{"style":248},[10713],{"type":45,"value":356},{"type":40,"tag":139,"props":10715,"children":10716},{"style":254},[10717],{"type":45,"value":10718},"result)",{"type":40,"tag":139,"props":10720,"children":10721},{"style":248},[10722],{"type":45,"value":9413},{"type":40,"tag":139,"props":10724,"children":10725},{"style":338},[10726],{"type":45,"value":383},{"type":40,"tag":139,"props":10728,"children":10729},{"style":248},[10730],{"type":45,"value":286},{"type":40,"tag":139,"props":10732,"children":10733},{"class":141,"line":1296},[10734],{"type":40,"tag":139,"props":10735,"children":10736},{"style":248},[10737],{"type":45,"value":5988},{"type":40,"tag":117,"props":10739,"children":10740},{},[],{"type":40,"tag":121,"props":10742,"children":10744},{"id":10743},"format-conversion",[10745],{"type":45,"value":10746},"Format Conversion",{"type":40,"tag":48,"props":10748,"children":10749},{},[10750],{"type":45,"value":10751},"Convert between ecosystem formats for interoperability:",{"type":40,"tag":403,"props":10753,"children":10755},{"id":10754},"openai-format",[10756],{"type":45,"value":10757},"OpenAI Format",{"type":40,"tag":128,"props":10759,"children":10761},{"className":231,"code":10760,"language":19,"meta":133,"style":133},"import { fromChatMessages, toChatMessage } from '@openrouter\u002Fagent';\n\n\u002F\u002F OpenAI messages → OpenRouter format\nconst result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: fromChatMessages(openaiMessages)\n});\n\n\u002F\u002F Response → OpenAI chat message format\nconst response = await result.getResponse();\nconst chatMsg = toChatMessage(response);\n",[10762],{"type":40,"tag":54,"props":10763,"children":10764},{"__ignoreMap":133},[10765,10814,10821,10829,10864,10891,10911,10926,10933,10941,10980],{"type":40,"tag":139,"props":10766,"children":10767},{"class":141,"line":142},[10768,10772,10776,10781,10785,10790,10794,10798,10802,10806,10810],{"type":40,"tag":139,"props":10769,"children":10770},{"style":242},[10771],{"type":45,"value":245},{"type":40,"tag":139,"props":10773,"children":10774},{"style":248},[10775],{"type":45,"value":251},{"type":40,"tag":139,"props":10777,"children":10778},{"style":254},[10779],{"type":45,"value":10780}," fromChatMessages",{"type":40,"tag":139,"props":10782,"children":10783},{"style":248},[10784],{"type":45,"value":974},{"type":40,"tag":139,"props":10786,"children":10787},{"style":254},[10788],{"type":45,"value":10789}," toChatMessage",{"type":40,"tag":139,"props":10791,"children":10792},{"style":248},[10793],{"type":45,"value":262},{"type":40,"tag":139,"props":10795,"children":10796},{"style":242},[10797],{"type":45,"value":267},{"type":40,"tag":139,"props":10799,"children":10800},{"style":248},[10801],{"type":45,"value":272},{"type":40,"tag":139,"props":10803,"children":10804},{"style":162},[10805],{"type":45,"value":84},{"type":40,"tag":139,"props":10807,"children":10808},{"style":248},[10809],{"type":45,"value":281},{"type":40,"tag":139,"props":10811,"children":10812},{"style":248},[10813],{"type":45,"value":286},{"type":40,"tag":139,"props":10815,"children":10816},{"class":141,"line":152},[10817],{"type":40,"tag":139,"props":10818,"children":10819},{"emptyLinePlaceholder":177},[10820],{"type":45,"value":180},{"type":40,"tag":139,"props":10822,"children":10823},{"class":141,"line":173},[10824],{"type":40,"tag":139,"props":10825,"children":10826},{"style":146},[10827],{"type":45,"value":10828},"\u002F\u002F OpenAI messages → OpenRouter format\n",{"type":40,"tag":139,"props":10830,"children":10831},{"class":141,"line":183},[10832,10836,10840,10844,10848,10852,10856,10860],{"type":40,"tag":139,"props":10833,"children":10834},{"style":299},[10835],{"type":45,"value":302},{"type":40,"tag":139,"props":10837,"children":10838},{"style":254},[10839],{"type":45,"value":646},{"type":40,"tag":139,"props":10841,"children":10842},{"style":248},[10843],{"type":45,"value":312},{"type":40,"tag":139,"props":10845,"children":10846},{"style":254},[10847],{"type":45,"value":655},{"type":40,"tag":139,"props":10849,"children":10850},{"style":248},[10851],{"type":45,"value":356},{"type":40,"tag":139,"props":10853,"children":10854},{"style":320},[10855],{"type":45,"value":59},{"type":40,"tag":139,"props":10857,"children":10858},{"style":254},[10859],{"type":45,"value":327},{"type":40,"tag":139,"props":10861,"children":10862},{"style":248},[10863],{"type":45,"value":332},{"type":40,"tag":139,"props":10865,"children":10866},{"class":141,"line":192},[10867,10871,10875,10879,10883,10887],{"type":40,"tag":139,"props":10868,"children":10869},{"style":338},[10870],{"type":45,"value":679},{"type":40,"tag":139,"props":10872,"children":10873},{"style":248},[10874],{"type":45,"value":346},{"type":40,"tag":139,"props":10876,"children":10877},{"style":248},[10878],{"type":45,"value":272},{"type":40,"tag":139,"props":10880,"children":10881},{"style":162},[10882],{"type":45,"value":692},{"type":40,"tag":139,"props":10884,"children":10885},{"style":248},[10886],{"type":45,"value":281},{"type":40,"tag":139,"props":10888,"children":10889},{"style":248},[10890],{"type":45,"value":701},{"type":40,"tag":139,"props":10892,"children":10893},{"class":141,"line":995},[10894,10898,10902,10906],{"type":40,"tag":139,"props":10895,"children":10896},{"style":338},[10897],{"type":45,"value":709},{"type":40,"tag":139,"props":10899,"children":10900},{"style":248},[10901],{"type":45,"value":346},{"type":40,"tag":139,"props":10903,"children":10904},{"style":320},[10905],{"type":45,"value":10780},{"type":40,"tag":139,"props":10907,"children":10908},{"style":254},[10909],{"type":45,"value":10910},"(openaiMessages)\n",{"type":40,"tag":139,"props":10912,"children":10913},{"class":141,"line":1213},[10914,10918,10922],{"type":40,"tag":139,"props":10915,"children":10916},{"style":248},[10917],{"type":45,"value":378},{"type":40,"tag":139,"props":10919,"children":10920},{"style":254},[10921],{"type":45,"value":383},{"type":40,"tag":139,"props":10923,"children":10924},{"style":248},[10925],{"type":45,"value":286},{"type":40,"tag":139,"props":10927,"children":10928},{"class":141,"line":1229},[10929],{"type":40,"tag":139,"props":10930,"children":10931},{"emptyLinePlaceholder":177},[10932],{"type":45,"value":180},{"type":40,"tag":139,"props":10934,"children":10935},{"class":141,"line":1237},[10936],{"type":40,"tag":139,"props":10937,"children":10938},{"style":146},[10939],{"type":45,"value":10940},"\u002F\u002F Response → OpenAI chat message format\n",{"type":40,"tag":139,"props":10942,"children":10943},{"class":141,"line":1246},[10944,10948,10952,10956,10960,10964,10968,10972,10976],{"type":40,"tag":139,"props":10945,"children":10946},{"style":299},[10947],{"type":45,"value":302},{"type":40,"tag":139,"props":10949,"children":10950},{"style":254},[10951],{"type":45,"value":5630},{"type":40,"tag":139,"props":10953,"children":10954},{"style":248},[10955],{"type":45,"value":312},{"type":40,"tag":139,"props":10957,"children":10958},{"style":242},[10959],{"type":45,"value":903},{"type":40,"tag":139,"props":10961,"children":10962},{"style":254},[10963],{"type":45,"value":3762},{"type":40,"tag":139,"props":10965,"children":10966},{"style":248},[10967],{"type":45,"value":356},{"type":40,"tag":139,"props":10969,"children":10970},{"style":320},[10971],{"type":45,"value":5651},{"type":40,"tag":139,"props":10973,"children":10974},{"style":254},[10975],{"type":45,"value":931},{"type":40,"tag":139,"props":10977,"children":10978},{"style":248},[10979],{"type":45,"value":286},{"type":40,"tag":139,"props":10981,"children":10982},{"class":141,"line":1296},[10983,10987,10992,10996,11000,11005],{"type":40,"tag":139,"props":10984,"children":10985},{"style":299},[10986],{"type":45,"value":302},{"type":40,"tag":139,"props":10988,"children":10989},{"style":254},[10990],{"type":45,"value":10991}," chatMsg ",{"type":40,"tag":139,"props":10993,"children":10994},{"style":248},[10995],{"type":45,"value":312},{"type":40,"tag":139,"props":10997,"children":10998},{"style":320},[10999],{"type":45,"value":10789},{"type":40,"tag":139,"props":11001,"children":11002},{"style":254},[11003],{"type":45,"value":11004},"(response)",{"type":40,"tag":139,"props":11006,"children":11007},{"style":248},[11008],{"type":45,"value":286},{"type":40,"tag":403,"props":11010,"children":11012},{"id":11011},"claude-format",[11013],{"type":45,"value":11014},"Claude Format",{"type":40,"tag":128,"props":11016,"children":11018},{"className":231,"code":11017,"language":19,"meta":133,"style":133},"import { fromClaudeMessages, toClaudeMessage } from '@openrouter\u002Fagent';\n\n\u002F\u002F Claude messages → OpenRouter format\nconst result = client.callModel({\n  model: 'anthropic\u002Fclaude-3-opus',\n  input: fromClaudeMessages(claudeMessages)\n});\n\n\u002F\u002F Response → Claude message format\nconst response = await result.getResponse();\nconst claudeMsg = toClaudeMessage(response);\n",[11019],{"type":40,"tag":54,"props":11020,"children":11021},{"__ignoreMap":133},[11022,11071,11078,11086,11121,11149,11169,11184,11191,11199,11238],{"type":40,"tag":139,"props":11023,"children":11024},{"class":141,"line":142},[11025,11029,11033,11038,11042,11047,11051,11055,11059,11063,11067],{"type":40,"tag":139,"props":11026,"children":11027},{"style":242},[11028],{"type":45,"value":245},{"type":40,"tag":139,"props":11030,"children":11031},{"style":248},[11032],{"type":45,"value":251},{"type":40,"tag":139,"props":11034,"children":11035},{"style":254},[11036],{"type":45,"value":11037}," fromClaudeMessages",{"type":40,"tag":139,"props":11039,"children":11040},{"style":248},[11041],{"type":45,"value":974},{"type":40,"tag":139,"props":11043,"children":11044},{"style":254},[11045],{"type":45,"value":11046}," toClaudeMessage",{"type":40,"tag":139,"props":11048,"children":11049},{"style":248},[11050],{"type":45,"value":262},{"type":40,"tag":139,"props":11052,"children":11053},{"style":242},[11054],{"type":45,"value":267},{"type":40,"tag":139,"props":11056,"children":11057},{"style":248},[11058],{"type":45,"value":272},{"type":40,"tag":139,"props":11060,"children":11061},{"style":162},[11062],{"type":45,"value":84},{"type":40,"tag":139,"props":11064,"children":11065},{"style":248},[11066],{"type":45,"value":281},{"type":40,"tag":139,"props":11068,"children":11069},{"style":248},[11070],{"type":45,"value":286},{"type":40,"tag":139,"props":11072,"children":11073},{"class":141,"line":152},[11074],{"type":40,"tag":139,"props":11075,"children":11076},{"emptyLinePlaceholder":177},[11077],{"type":45,"value":180},{"type":40,"tag":139,"props":11079,"children":11080},{"class":141,"line":173},[11081],{"type":40,"tag":139,"props":11082,"children":11083},{"style":146},[11084],{"type":45,"value":11085},"\u002F\u002F Claude messages → OpenRouter format\n",{"type":40,"tag":139,"props":11087,"children":11088},{"class":141,"line":183},[11089,11093,11097,11101,11105,11109,11113,11117],{"type":40,"tag":139,"props":11090,"children":11091},{"style":299},[11092],{"type":45,"value":302},{"type":40,"tag":139,"props":11094,"children":11095},{"style":254},[11096],{"type":45,"value":646},{"type":40,"tag":139,"props":11098,"children":11099},{"style":248},[11100],{"type":45,"value":312},{"type":40,"tag":139,"props":11102,"children":11103},{"style":254},[11104],{"type":45,"value":655},{"type":40,"tag":139,"props":11106,"children":11107},{"style":248},[11108],{"type":45,"value":356},{"type":40,"tag":139,"props":11110,"children":11111},{"style":320},[11112],{"type":45,"value":59},{"type":40,"tag":139,"props":11114,"children":11115},{"style":254},[11116],{"type":45,"value":327},{"type":40,"tag":139,"props":11118,"children":11119},{"style":248},[11120],{"type":45,"value":332},{"type":40,"tag":139,"props":11122,"children":11123},{"class":141,"line":192},[11124,11128,11132,11136,11141,11145],{"type":40,"tag":139,"props":11125,"children":11126},{"style":338},[11127],{"type":45,"value":679},{"type":40,"tag":139,"props":11129,"children":11130},{"style":248},[11131],{"type":45,"value":346},{"type":40,"tag":139,"props":11133,"children":11134},{"style":248},[11135],{"type":45,"value":272},{"type":40,"tag":139,"props":11137,"children":11138},{"style":162},[11139],{"type":45,"value":11140},"anthropic\u002Fclaude-3-opus",{"type":40,"tag":139,"props":11142,"children":11143},{"style":248},[11144],{"type":45,"value":281},{"type":40,"tag":139,"props":11146,"children":11147},{"style":248},[11148],{"type":45,"value":701},{"type":40,"tag":139,"props":11150,"children":11151},{"class":141,"line":995},[11152,11156,11160,11164],{"type":40,"tag":139,"props":11153,"children":11154},{"style":338},[11155],{"type":45,"value":709},{"type":40,"tag":139,"props":11157,"children":11158},{"style":248},[11159],{"type":45,"value":346},{"type":40,"tag":139,"props":11161,"children":11162},{"style":320},[11163],{"type":45,"value":11037},{"type":40,"tag":139,"props":11165,"children":11166},{"style":254},[11167],{"type":45,"value":11168},"(claudeMessages)\n",{"type":40,"tag":139,"props":11170,"children":11171},{"class":141,"line":1213},[11172,11176,11180],{"type":40,"tag":139,"props":11173,"children":11174},{"style":248},[11175],{"type":45,"value":378},{"type":40,"tag":139,"props":11177,"children":11178},{"style":254},[11179],{"type":45,"value":383},{"type":40,"tag":139,"props":11181,"children":11182},{"style":248},[11183],{"type":45,"value":286},{"type":40,"tag":139,"props":11185,"children":11186},{"class":141,"line":1229},[11187],{"type":40,"tag":139,"props":11188,"children":11189},{"emptyLinePlaceholder":177},[11190],{"type":45,"value":180},{"type":40,"tag":139,"props":11192,"children":11193},{"class":141,"line":1237},[11194],{"type":40,"tag":139,"props":11195,"children":11196},{"style":146},[11197],{"type":45,"value":11198},"\u002F\u002F Response → Claude message format\n",{"type":40,"tag":139,"props":11200,"children":11201},{"class":141,"line":1246},[11202,11206,11210,11214,11218,11222,11226,11230,11234],{"type":40,"tag":139,"props":11203,"children":11204},{"style":299},[11205],{"type":45,"value":302},{"type":40,"tag":139,"props":11207,"children":11208},{"style":254},[11209],{"type":45,"value":5630},{"type":40,"tag":139,"props":11211,"children":11212},{"style":248},[11213],{"type":45,"value":312},{"type":40,"tag":139,"props":11215,"children":11216},{"style":242},[11217],{"type":45,"value":903},{"type":40,"tag":139,"props":11219,"children":11220},{"style":254},[11221],{"type":45,"value":3762},{"type":40,"tag":139,"props":11223,"children":11224},{"style":248},[11225],{"type":45,"value":356},{"type":40,"tag":139,"props":11227,"children":11228},{"style":320},[11229],{"type":45,"value":5651},{"type":40,"tag":139,"props":11231,"children":11232},{"style":254},[11233],{"type":45,"value":931},{"type":40,"tag":139,"props":11235,"children":11236},{"style":248},[11237],{"type":45,"value":286},{"type":40,"tag":139,"props":11239,"children":11240},{"class":141,"line":1296},[11241,11245,11250,11254,11258,11262],{"type":40,"tag":139,"props":11242,"children":11243},{"style":299},[11244],{"type":45,"value":302},{"type":40,"tag":139,"props":11246,"children":11247},{"style":254},[11248],{"type":45,"value":11249}," claudeMsg ",{"type":40,"tag":139,"props":11251,"children":11252},{"style":248},[11253],{"type":45,"value":312},{"type":40,"tag":139,"props":11255,"children":11256},{"style":320},[11257],{"type":45,"value":11046},{"type":40,"tag":139,"props":11259,"children":11260},{"style":254},[11261],{"type":45,"value":11004},{"type":40,"tag":139,"props":11263,"children":11264},{"style":248},[11265],{"type":45,"value":286},{"type":40,"tag":117,"props":11267,"children":11268},{},[],{"type":40,"tag":121,"props":11270,"children":11272},{"id":11271},"responses-api-message-shapes",[11273],{"type":45,"value":11274},"Responses API Message Shapes",{"type":40,"tag":48,"props":11276,"children":11277},{},[11278,11280,11285],{"type":45,"value":11279},"The SDK uses the ",{"type":40,"tag":76,"props":11281,"children":11282},{},[11283],{"type":45,"value":11284},"OpenResponses",{"type":45,"value":11286}," format for messages. Understanding these shapes is essential for building robust agents.",{"type":40,"tag":403,"props":11288,"children":11290},{"id":11289},"message-roles",[11291],{"type":45,"value":11292},"Message Roles",{"type":40,"tag":48,"props":11294,"children":11295},{},[11296,11298,11304],{"type":45,"value":11297},"Messages contain a ",{"type":40,"tag":54,"props":11299,"children":11301},{"className":11300},[],[11302],{"type":45,"value":11303},"role",{"type":45,"value":11305}," property that determines the message type:",{"type":40,"tag":1801,"props":11307,"children":11308},{},[11309,11324],{"type":40,"tag":1805,"props":11310,"children":11311},{},[11312],{"type":40,"tag":1809,"props":11313,"children":11314},{},[11315,11320],{"type":40,"tag":1813,"props":11316,"children":11317},{},[11318],{"type":45,"value":11319},"Role",{"type":40,"tag":1813,"props":11321,"children":11322},{},[11323],{"type":45,"value":1832},{"type":40,"tag":1834,"props":11325,"children":11326},{},[11327,11343,11359,11376,11393],{"type":40,"tag":1809,"props":11328,"children":11329},{},[11330,11338],{"type":40,"tag":1841,"props":11331,"children":11332},{},[11333],{"type":40,"tag":54,"props":11334,"children":11336},{"className":11335},[],[11337],{"type":45,"value":4549},{"type":40,"tag":1841,"props":11339,"children":11340},{},[11341],{"type":45,"value":11342},"User-provided input",{"type":40,"tag":1809,"props":11344,"children":11345},{},[11346,11354],{"type":40,"tag":1841,"props":11347,"children":11348},{},[11349],{"type":40,"tag":54,"props":11350,"children":11352},{"className":11351},[],[11353],{"type":45,"value":4608},{"type":40,"tag":1841,"props":11355,"children":11356},{},[11357],{"type":45,"value":11358},"Model-generated responses",{"type":40,"tag":1809,"props":11360,"children":11361},{},[11362,11371],{"type":40,"tag":1841,"props":11363,"children":11364},{},[11365],{"type":40,"tag":54,"props":11366,"children":11368},{"className":11367},[],[11369],{"type":45,"value":11370},"system",{"type":40,"tag":1841,"props":11372,"children":11373},{},[11374],{"type":45,"value":11375},"System instructions",{"type":40,"tag":1809,"props":11377,"children":11378},{},[11379,11388],{"type":40,"tag":1841,"props":11380,"children":11381},{},[11382],{"type":40,"tag":54,"props":11383,"children":11385},{"className":11384},[],[11386],{"type":45,"value":11387},"developer",{"type":40,"tag":1841,"props":11389,"children":11390},{},[11391],{"type":45,"value":11392},"Developer-level directives",{"type":40,"tag":1809,"props":11394,"children":11395},{},[11396,11405],{"type":40,"tag":1841,"props":11397,"children":11398},{},[11399],{"type":40,"tag":54,"props":11400,"children":11402},{"className":11401},[],[11403],{"type":45,"value":11404},"tool",{"type":40,"tag":1841,"props":11406,"children":11407},{},[11408],{"type":45,"value":11409},"Tool execution results",{"type":40,"tag":403,"props":11411,"children":11413},{"id":11412},"text-message",[11414],{"type":45,"value":11415},"Text Message",{"type":40,"tag":48,"props":11417,"children":11418},{},[11419],{"type":45,"value":11420},"Simple text content from user or assistant:",{"type":40,"tag":128,"props":11422,"children":11424},{"className":231,"code":11423,"language":19,"meta":133,"style":133},"interface TextMessage {\n  role: 'user' | 'assistant';\n  content: string;\n}\n",[11425],{"type":40,"tag":54,"props":11426,"children":11427},{"__ignoreMap":133},[11428,11445,11490,11511],{"type":40,"tag":139,"props":11429,"children":11430},{"class":141,"line":142},[11431,11436,11441],{"type":40,"tag":139,"props":11432,"children":11433},{"style":299},[11434],{"type":45,"value":11435},"interface",{"type":40,"tag":139,"props":11437,"children":11438},{"style":156},[11439],{"type":45,"value":11440}," TextMessage",{"type":40,"tag":139,"props":11442,"children":11443},{"style":248},[11444],{"type":45,"value":1436},{"type":40,"tag":139,"props":11446,"children":11447},{"class":141,"line":152},[11448,11453,11457,11461,11465,11469,11474,11478,11482,11486],{"type":40,"tag":139,"props":11449,"children":11450},{"style":338},[11451],{"type":45,"value":11452},"  role",{"type":40,"tag":139,"props":11454,"children":11455},{"style":248},[11456],{"type":45,"value":346},{"type":40,"tag":139,"props":11458,"children":11459},{"style":248},[11460],{"type":45,"value":272},{"type":40,"tag":139,"props":11462,"children":11463},{"style":162},[11464],{"type":45,"value":4549},{"type":40,"tag":139,"props":11466,"children":11467},{"style":248},[11468],{"type":45,"value":281},{"type":40,"tag":139,"props":11470,"children":11471},{"style":248},[11472],{"type":45,"value":11473}," |",{"type":40,"tag":139,"props":11475,"children":11476},{"style":248},[11477],{"type":45,"value":272},{"type":40,"tag":139,"props":11479,"children":11480},{"style":162},[11481],{"type":45,"value":4608},{"type":40,"tag":139,"props":11483,"children":11484},{"style":248},[11485],{"type":45,"value":281},{"type":40,"tag":139,"props":11487,"children":11488},{"style":248},[11489],{"type":45,"value":286},{"type":40,"tag":139,"props":11491,"children":11492},{"class":141,"line":173},[11493,11498,11502,11507],{"type":40,"tag":139,"props":11494,"children":11495},{"style":338},[11496],{"type":45,"value":11497},"  content",{"type":40,"tag":139,"props":11499,"children":11500},{"style":248},[11501],{"type":45,"value":346},{"type":40,"tag":139,"props":11503,"children":11504},{"style":156},[11505],{"type":45,"value":11506}," string",{"type":40,"tag":139,"props":11508,"children":11509},{"style":248},[11510],{"type":45,"value":286},{"type":40,"tag":139,"props":11512,"children":11513},{"class":141,"line":183},[11514],{"type":40,"tag":139,"props":11515,"children":11516},{"style":248},[11517],{"type":45,"value":5988},{"type":40,"tag":403,"props":11519,"children":11521},{"id":11520},"multimodal-message-array-content",[11522],{"type":45,"value":11523},"Multimodal Message (Array Content)",{"type":40,"tag":48,"props":11525,"children":11526},{},[11527],{"type":45,"value":11528},"Messages with mixed content types:",{"type":40,"tag":128,"props":11530,"children":11532},{"className":231,"code":11531,"language":19,"meta":133,"style":133},"interface MultimodalMessage {\n  role: 'user';\n  content: Array\u003C\n    | { type: 'input_text'; text: string }\n    | { type: 'input_image'; imageUrl: string; detail?: 'auto' | 'low' | 'high' }\n    | {\n        type: 'image';\n        source: {\n          type: 'url' | 'base64';\n          url?: string;\n          media_type?: string;\n          data?: string\n        }\n      }\n  >;\n}\n",[11533],{"type":40,"tag":54,"props":11534,"children":11535},{"__ignoreMap":133},[11536,11552,11579,11600,11653,11767,11778,11807,11823,11869,11889,11909,11925,11933,11941,11949],{"type":40,"tag":139,"props":11537,"children":11538},{"class":141,"line":142},[11539,11543,11548],{"type":40,"tag":139,"props":11540,"children":11541},{"style":299},[11542],{"type":45,"value":11435},{"type":40,"tag":139,"props":11544,"children":11545},{"style":156},[11546],{"type":45,"value":11547}," MultimodalMessage",{"type":40,"tag":139,"props":11549,"children":11550},{"style":248},[11551],{"type":45,"value":1436},{"type":40,"tag":139,"props":11553,"children":11554},{"class":141,"line":152},[11555,11559,11563,11567,11571,11575],{"type":40,"tag":139,"props":11556,"children":11557},{"style":338},[11558],{"type":45,"value":11452},{"type":40,"tag":139,"props":11560,"children":11561},{"style":248},[11562],{"type":45,"value":346},{"type":40,"tag":139,"props":11564,"children":11565},{"style":248},[11566],{"type":45,"value":272},{"type":40,"tag":139,"props":11568,"children":11569},{"style":162},[11570],{"type":45,"value":4549},{"type":40,"tag":139,"props":11572,"children":11573},{"style":248},[11574],{"type":45,"value":281},{"type":40,"tag":139,"props":11576,"children":11577},{"style":248},[11578],{"type":45,"value":286},{"type":40,"tag":139,"props":11580,"children":11581},{"class":141,"line":173},[11582,11586,11590,11595],{"type":40,"tag":139,"props":11583,"children":11584},{"style":338},[11585],{"type":45,"value":11497},{"type":40,"tag":139,"props":11587,"children":11588},{"style":248},[11589],{"type":45,"value":346},{"type":40,"tag":139,"props":11591,"children":11592},{"style":156},[11593],{"type":45,"value":11594}," Array",{"type":40,"tag":139,"props":11596,"children":11597},{"style":248},[11598],{"type":45,"value":11599},"\u003C\n",{"type":40,"tag":139,"props":11601,"children":11602},{"class":141,"line":183},[11603,11608,11612,11616,11620,11624,11629,11633,11637,11641,11645,11649],{"type":40,"tag":139,"props":11604,"children":11605},{"style":248},[11606],{"type":45,"value":11607},"    |",{"type":40,"tag":139,"props":11609,"children":11610},{"style":248},[11611],{"type":45,"value":251},{"type":40,"tag":139,"props":11613,"children":11614},{"style":338},[11615],{"type":45,"value":4881},{"type":40,"tag":139,"props":11617,"children":11618},{"style":248},[11619],{"type":45,"value":346},{"type":40,"tag":139,"props":11621,"children":11622},{"style":248},[11623],{"type":45,"value":272},{"type":40,"tag":139,"props":11625,"children":11626},{"style":162},[11627],{"type":45,"value":11628},"input_text",{"type":40,"tag":139,"props":11630,"children":11631},{"style":248},[11632],{"type":45,"value":281},{"type":40,"tag":139,"props":11634,"children":11635},{"style":248},[11636],{"type":45,"value":2056},{"type":40,"tag":139,"props":11638,"children":11639},{"style":338},[11640],{"type":45,"value":3887},{"type":40,"tag":139,"props":11642,"children":11643},{"style":248},[11644],{"type":45,"value":346},{"type":40,"tag":139,"props":11646,"children":11647},{"style":156},[11648],{"type":45,"value":11506},{"type":40,"tag":139,"props":11650,"children":11651},{"style":248},[11652],{"type":45,"value":4698},{"type":40,"tag":139,"props":11654,"children":11655},{"class":141,"line":192},[11656,11660,11664,11668,11672,11676,11681,11685,11689,11694,11698,11702,11706,11711,11716,11720,11725,11729,11733,11737,11742,11746,11750,11754,11759,11763],{"type":40,"tag":139,"props":11657,"children":11658},{"style":248},[11659],{"type":45,"value":11607},{"type":40,"tag":139,"props":11661,"children":11662},{"style":248},[11663],{"type":45,"value":251},{"type":40,"tag":139,"props":11665,"children":11666},{"style":338},[11667],{"type":45,"value":4881},{"type":40,"tag":139,"props":11669,"children":11670},{"style":248},[11671],{"type":45,"value":346},{"type":40,"tag":139,"props":11673,"children":11674},{"style":248},[11675],{"type":45,"value":272},{"type":40,"tag":139,"props":11677,"children":11678},{"style":162},[11679],{"type":45,"value":11680},"input_image",{"type":40,"tag":139,"props":11682,"children":11683},{"style":248},[11684],{"type":45,"value":281},{"type":40,"tag":139,"props":11686,"children":11687},{"style":248},[11688],{"type":45,"value":2056},{"type":40,"tag":139,"props":11690,"children":11691},{"style":338},[11692],{"type":45,"value":11693}," imageUrl",{"type":40,"tag":139,"props":11695,"children":11696},{"style":248},[11697],{"type":45,"value":346},{"type":40,"tag":139,"props":11699,"children":11700},{"style":156},[11701],{"type":45,"value":11506},{"type":40,"tag":139,"props":11703,"children":11704},{"style":248},[11705],{"type":45,"value":2056},{"type":40,"tag":139,"props":11707,"children":11708},{"style":338},[11709],{"type":45,"value":11710}," detail",{"type":40,"tag":139,"props":11712,"children":11713},{"style":248},[11714],{"type":45,"value":11715},"?:",{"type":40,"tag":139,"props":11717,"children":11718},{"style":248},[11719],{"type":45,"value":272},{"type":40,"tag":139,"props":11721,"children":11722},{"style":162},[11723],{"type":45,"value":11724},"auto",{"type":40,"tag":139,"props":11726,"children":11727},{"style":248},[11728],{"type":45,"value":281},{"type":40,"tag":139,"props":11730,"children":11731},{"style":248},[11732],{"type":45,"value":11473},{"type":40,"tag":139,"props":11734,"children":11735},{"style":248},[11736],{"type":45,"value":272},{"type":40,"tag":139,"props":11738,"children":11739},{"style":162},[11740],{"type":45,"value":11741},"low",{"type":40,"tag":139,"props":11743,"children":11744},{"style":248},[11745],{"type":45,"value":281},{"type":40,"tag":139,"props":11747,"children":11748},{"style":248},[11749],{"type":45,"value":11473},{"type":40,"tag":139,"props":11751,"children":11752},{"style":248},[11753],{"type":45,"value":272},{"type":40,"tag":139,"props":11755,"children":11756},{"style":162},[11757],{"type":45,"value":11758},"high",{"type":40,"tag":139,"props":11760,"children":11761},{"style":248},[11762],{"type":45,"value":281},{"type":40,"tag":139,"props":11764,"children":11765},{"style":248},[11766],{"type":45,"value":4698},{"type":40,"tag":139,"props":11768,"children":11769},{"class":141,"line":995},[11770,11774],{"type":40,"tag":139,"props":11771,"children":11772},{"style":248},[11773],{"type":45,"value":11607},{"type":40,"tag":139,"props":11775,"children":11776},{"style":248},[11777],{"type":45,"value":1436},{"type":40,"tag":139,"props":11779,"children":11780},{"class":141,"line":1213},[11781,11786,11790,11794,11799,11803],{"type":40,"tag":139,"props":11782,"children":11783},{"style":338},[11784],{"type":45,"value":11785},"        type",{"type":40,"tag":139,"props":11787,"children":11788},{"style":248},[11789],{"type":45,"value":346},{"type":40,"tag":139,"props":11791,"children":11792},{"style":248},[11793],{"type":45,"value":272},{"type":40,"tag":139,"props":11795,"children":11796},{"style":162},[11797],{"type":45,"value":11798},"image",{"type":40,"tag":139,"props":11800,"children":11801},{"style":248},[11802],{"type":45,"value":281},{"type":40,"tag":139,"props":11804,"children":11805},{"style":248},[11806],{"type":45,"value":286},{"type":40,"tag":139,"props":11808,"children":11809},{"class":141,"line":1229},[11810,11815,11819],{"type":40,"tag":139,"props":11811,"children":11812},{"style":338},[11813],{"type":45,"value":11814},"        source",{"type":40,"tag":139,"props":11816,"children":11817},{"style":248},[11818],{"type":45,"value":346},{"type":40,"tag":139,"props":11820,"children":11821},{"style":248},[11822],{"type":45,"value":1436},{"type":40,"tag":139,"props":11824,"children":11825},{"class":141,"line":1237},[11826,11831,11835,11839,11844,11848,11852,11856,11861,11865],{"type":40,"tag":139,"props":11827,"children":11828},{"style":338},[11829],{"type":45,"value":11830},"          type",{"type":40,"tag":139,"props":11832,"children":11833},{"style":248},[11834],{"type":45,"value":346},{"type":40,"tag":139,"props":11836,"children":11837},{"style":248},[11838],{"type":45,"value":272},{"type":40,"tag":139,"props":11840,"children":11841},{"style":162},[11842],{"type":45,"value":11843},"url",{"type":40,"tag":139,"props":11845,"children":11846},{"style":248},[11847],{"type":45,"value":281},{"type":40,"tag":139,"props":11849,"children":11850},{"style":248},[11851],{"type":45,"value":11473},{"type":40,"tag":139,"props":11853,"children":11854},{"style":248},[11855],{"type":45,"value":272},{"type":40,"tag":139,"props":11857,"children":11858},{"style":162},[11859],{"type":45,"value":11860},"base64",{"type":40,"tag":139,"props":11862,"children":11863},{"style":248},[11864],{"type":45,"value":281},{"type":40,"tag":139,"props":11866,"children":11867},{"style":248},[11868],{"type":45,"value":286},{"type":40,"tag":139,"props":11870,"children":11871},{"class":141,"line":1246},[11872,11877,11881,11885],{"type":40,"tag":139,"props":11873,"children":11874},{"style":338},[11875],{"type":45,"value":11876},"          url",{"type":40,"tag":139,"props":11878,"children":11879},{"style":248},[11880],{"type":45,"value":11715},{"type":40,"tag":139,"props":11882,"children":11883},{"style":156},[11884],{"type":45,"value":11506},{"type":40,"tag":139,"props":11886,"children":11887},{"style":248},[11888],{"type":45,"value":286},{"type":40,"tag":139,"props":11890,"children":11891},{"class":141,"line":1296},[11892,11897,11901,11905],{"type":40,"tag":139,"props":11893,"children":11894},{"style":338},[11895],{"type":45,"value":11896},"          media_type",{"type":40,"tag":139,"props":11898,"children":11899},{"style":248},[11900],{"type":45,"value":11715},{"type":40,"tag":139,"props":11902,"children":11903},{"style":156},[11904],{"type":45,"value":11506},{"type":40,"tag":139,"props":11906,"children":11907},{"style":248},[11908],{"type":45,"value":286},{"type":40,"tag":139,"props":11910,"children":11911},{"class":141,"line":1322},[11912,11917,11921],{"type":40,"tag":139,"props":11913,"children":11914},{"style":338},[11915],{"type":45,"value":11916},"          data",{"type":40,"tag":139,"props":11918,"children":11919},{"style":248},[11920],{"type":45,"value":11715},{"type":40,"tag":139,"props":11922,"children":11923},{"style":156},[11924],{"type":45,"value":3220},{"type":40,"tag":139,"props":11926,"children":11927},{"class":141,"line":1338},[11928],{"type":40,"tag":139,"props":11929,"children":11930},{"style":248},[11931],{"type":45,"value":11932},"        }\n",{"type":40,"tag":139,"props":11934,"children":11935},{"class":141,"line":1346},[11936],{"type":40,"tag":139,"props":11937,"children":11938},{"style":248},[11939],{"type":45,"value":11940},"      }\n",{"type":40,"tag":139,"props":11942,"children":11943},{"class":141,"line":1355},[11944],{"type":40,"tag":139,"props":11945,"children":11946},{"style":248},[11947],{"type":45,"value":11948},"  >;\n",{"type":40,"tag":139,"props":11950,"children":11951},{"class":141,"line":1393},[11952],{"type":40,"tag":139,"props":11953,"children":11954},{"style":248},[11955],{"type":45,"value":5988},{"type":40,"tag":403,"props":11957,"children":11959},{"id":11958},"tool-function-call-message",[11960],{"type":45,"value":11961},"Tool Function Call Message",{"type":40,"tag":48,"props":11963,"children":11964},{},[11965],{"type":45,"value":11966},"When the model requests a tool execution:",{"type":40,"tag":128,"props":11968,"children":11970},{"className":231,"code":11969,"language":19,"meta":133,"style":133},"interface ToolCallMessage {\n  role: 'assistant';\n  content?: null;\n  tool_calls?: Array\u003C{\n    id: string;\n    type: 'function';\n    function: {\n      name: string;\n      arguments: string;  \u002F\u002F JSON-encoded arguments\n    };\n  }>;\n}\n",[11971],{"type":40,"tag":54,"props":11972,"children":11973},{"__ignoreMap":133},[11974,11990,12017,12037,12058,12078,12106,12122,12142,12167,12174,12182],{"type":40,"tag":139,"props":11975,"children":11976},{"class":141,"line":142},[11977,11981,11986],{"type":40,"tag":139,"props":11978,"children":11979},{"style":299},[11980],{"type":45,"value":11435},{"type":40,"tag":139,"props":11982,"children":11983},{"style":156},[11984],{"type":45,"value":11985}," ToolCallMessage",{"type":40,"tag":139,"props":11987,"children":11988},{"style":248},[11989],{"type":45,"value":1436},{"type":40,"tag":139,"props":11991,"children":11992},{"class":141,"line":152},[11993,11997,12001,12005,12009,12013],{"type":40,"tag":139,"props":11994,"children":11995},{"style":338},[11996],{"type":45,"value":11452},{"type":40,"tag":139,"props":11998,"children":11999},{"style":248},[12000],{"type":45,"value":346},{"type":40,"tag":139,"props":12002,"children":12003},{"style":248},[12004],{"type":45,"value":272},{"type":40,"tag":139,"props":12006,"children":12007},{"style":162},[12008],{"type":45,"value":4608},{"type":40,"tag":139,"props":12010,"children":12011},{"style":248},[12012],{"type":45,"value":281},{"type":40,"tag":139,"props":12014,"children":12015},{"style":248},[12016],{"type":45,"value":286},{"type":40,"tag":139,"props":12018,"children":12019},{"class":141,"line":173},[12020,12024,12028,12033],{"type":40,"tag":139,"props":12021,"children":12022},{"style":338},[12023],{"type":45,"value":11497},{"type":40,"tag":139,"props":12025,"children":12026},{"style":248},[12027],{"type":45,"value":11715},{"type":40,"tag":139,"props":12029,"children":12030},{"style":156},[12031],{"type":45,"value":12032}," null",{"type":40,"tag":139,"props":12034,"children":12035},{"style":248},[12036],{"type":45,"value":286},{"type":40,"tag":139,"props":12038,"children":12039},{"class":141,"line":183},[12040,12045,12049,12053],{"type":40,"tag":139,"props":12041,"children":12042},{"style":338},[12043],{"type":45,"value":12044},"  tool_calls",{"type":40,"tag":139,"props":12046,"children":12047},{"style":248},[12048],{"type":45,"value":11715},{"type":40,"tag":139,"props":12050,"children":12051},{"style":156},[12052],{"type":45,"value":11594},{"type":40,"tag":139,"props":12054,"children":12055},{"style":248},[12056],{"type":45,"value":12057},"\u003C{\n",{"type":40,"tag":139,"props":12059,"children":12060},{"class":141,"line":192},[12061,12066,12070,12074],{"type":40,"tag":139,"props":12062,"children":12063},{"style":338},[12064],{"type":45,"value":12065},"    id",{"type":40,"tag":139,"props":12067,"children":12068},{"style":248},[12069],{"type":45,"value":346},{"type":40,"tag":139,"props":12071,"children":12072},{"style":156},[12073],{"type":45,"value":11506},{"type":40,"tag":139,"props":12075,"children":12076},{"style":248},[12077],{"type":45,"value":286},{"type":40,"tag":139,"props":12079,"children":12080},{"class":141,"line":995},[12081,12085,12089,12093,12098,12102],{"type":40,"tag":139,"props":12082,"children":12083},{"style":338},[12084],{"type":45,"value":7392},{"type":40,"tag":139,"props":12086,"children":12087},{"style":248},[12088],{"type":45,"value":346},{"type":40,"tag":139,"props":12090,"children":12091},{"style":248},[12092],{"type":45,"value":272},{"type":40,"tag":139,"props":12094,"children":12095},{"style":162},[12096],{"type":45,"value":12097},"function",{"type":40,"tag":139,"props":12099,"children":12100},{"style":248},[12101],{"type":45,"value":281},{"type":40,"tag":139,"props":12103,"children":12104},{"style":248},[12105],{"type":45,"value":286},{"type":40,"tag":139,"props":12107,"children":12108},{"class":141,"line":1213},[12109,12114,12118],{"type":40,"tag":139,"props":12110,"children":12111},{"style":338},[12112],{"type":45,"value":12113},"    function",{"type":40,"tag":139,"props":12115,"children":12116},{"style":248},[12117],{"type":45,"value":346},{"type":40,"tag":139,"props":12119,"children":12120},{"style":248},[12121],{"type":45,"value":1436},{"type":40,"tag":139,"props":12123,"children":12124},{"class":141,"line":1229},[12125,12130,12134,12138],{"type":40,"tag":139,"props":12126,"children":12127},{"style":338},[12128],{"type":45,"value":12129},"      name",{"type":40,"tag":139,"props":12131,"children":12132},{"style":248},[12133],{"type":45,"value":346},{"type":40,"tag":139,"props":12135,"children":12136},{"style":156},[12137],{"type":45,"value":11506},{"type":40,"tag":139,"props":12139,"children":12140},{"style":248},[12141],{"type":45,"value":286},{"type":40,"tag":139,"props":12143,"children":12144},{"class":141,"line":1237},[12145,12150,12154,12158,12162],{"type":40,"tag":139,"props":12146,"children":12147},{"style":338},[12148],{"type":45,"value":12149},"      arguments",{"type":40,"tag":139,"props":12151,"children":12152},{"style":248},[12153],{"type":45,"value":346},{"type":40,"tag":139,"props":12155,"children":12156},{"style":156},[12157],{"type":45,"value":11506},{"type":40,"tag":139,"props":12159,"children":12160},{"style":248},[12161],{"type":45,"value":2056},{"type":40,"tag":139,"props":12163,"children":12164},{"style":146},[12165],{"type":45,"value":12166},"  \u002F\u002F JSON-encoded arguments\n",{"type":40,"tag":139,"props":12168,"children":12169},{"class":141,"line":1246},[12170],{"type":40,"tag":139,"props":12171,"children":12172},{"style":248},[12173],{"type":45,"value":6679},{"type":40,"tag":139,"props":12175,"children":12176},{"class":141,"line":1296},[12177],{"type":40,"tag":139,"props":12178,"children":12179},{"style":248},[12180],{"type":45,"value":12181},"  }>;\n",{"type":40,"tag":139,"props":12183,"children":12184},{"class":141,"line":1322},[12185],{"type":40,"tag":139,"props":12186,"children":12187},{"style":248},[12188],{"type":45,"value":5988},{"type":40,"tag":403,"props":12190,"children":12192},{"id":12191},"tool-result-message",[12193],{"type":45,"value":12194},"Tool Result Message",{"type":40,"tag":48,"props":12196,"children":12197},{},[12198],{"type":45,"value":12199},"Result returned after tool execution:",{"type":40,"tag":128,"props":12201,"children":12203},{"className":231,"code":12202,"language":19,"meta":133,"style":133},"interface ToolResultMessage {\n  role: 'tool';\n  tool_call_id: string;\n  content: string;  \u002F\u002F JSON-encoded result\n}\n",[12204],{"type":40,"tag":54,"props":12205,"children":12206},{"__ignoreMap":133},[12207,12223,12250,12270,12294],{"type":40,"tag":139,"props":12208,"children":12209},{"class":141,"line":142},[12210,12214,12219],{"type":40,"tag":139,"props":12211,"children":12212},{"style":299},[12213],{"type":45,"value":11435},{"type":40,"tag":139,"props":12215,"children":12216},{"style":156},[12217],{"type":45,"value":12218}," ToolResultMessage",{"type":40,"tag":139,"props":12220,"children":12221},{"style":248},[12222],{"type":45,"value":1436},{"type":40,"tag":139,"props":12224,"children":12225},{"class":141,"line":152},[12226,12230,12234,12238,12242,12246],{"type":40,"tag":139,"props":12227,"children":12228},{"style":338},[12229],{"type":45,"value":11452},{"type":40,"tag":139,"props":12231,"children":12232},{"style":248},[12233],{"type":45,"value":346},{"type":40,"tag":139,"props":12235,"children":12236},{"style":248},[12237],{"type":45,"value":272},{"type":40,"tag":139,"props":12239,"children":12240},{"style":162},[12241],{"type":45,"value":11404},{"type":40,"tag":139,"props":12243,"children":12244},{"style":248},[12245],{"type":45,"value":281},{"type":40,"tag":139,"props":12247,"children":12248},{"style":248},[12249],{"type":45,"value":286},{"type":40,"tag":139,"props":12251,"children":12252},{"class":141,"line":173},[12253,12258,12262,12266],{"type":40,"tag":139,"props":12254,"children":12255},{"style":338},[12256],{"type":45,"value":12257},"  tool_call_id",{"type":40,"tag":139,"props":12259,"children":12260},{"style":248},[12261],{"type":45,"value":346},{"type":40,"tag":139,"props":12263,"children":12264},{"style":156},[12265],{"type":45,"value":11506},{"type":40,"tag":139,"props":12267,"children":12268},{"style":248},[12269],{"type":45,"value":286},{"type":40,"tag":139,"props":12271,"children":12272},{"class":141,"line":183},[12273,12277,12281,12285,12289],{"type":40,"tag":139,"props":12274,"children":12275},{"style":338},[12276],{"type":45,"value":11497},{"type":40,"tag":139,"props":12278,"children":12279},{"style":248},[12280],{"type":45,"value":346},{"type":40,"tag":139,"props":12282,"children":12283},{"style":156},[12284],{"type":45,"value":11506},{"type":40,"tag":139,"props":12286,"children":12287},{"style":248},[12288],{"type":45,"value":2056},{"type":40,"tag":139,"props":12290,"children":12291},{"style":146},[12292],{"type":45,"value":12293},"  \u002F\u002F JSON-encoded result\n",{"type":40,"tag":139,"props":12295,"children":12296},{"class":141,"line":192},[12297],{"type":40,"tag":139,"props":12298,"children":12299},{"style":248},[12300],{"type":45,"value":5988},{"type":40,"tag":403,"props":12302,"children":12304},{"id":12303},"non-streaming-response-structure",[12305],{"type":45,"value":12306},"Non-Streaming Response Structure",{"type":40,"tag":48,"props":12308,"children":12309},{},[12310,12312,12317],{"type":45,"value":12311},"The complete response object from ",{"type":40,"tag":54,"props":12313,"children":12315},{"className":12314},[],[12316],{"type":45,"value":5260},{"type":45,"value":346},{"type":40,"tag":128,"props":12319,"children":12321},{"className":231,"code":12320,"language":19,"meta":133,"style":133},"interface OpenResponsesNonStreamingResponse {\n  output: Array\u003CResponseMessage>;\n  usage?: {\n    inputTokens: number;\n    outputTokens: number;\n    cachedTokens?: number;\n  };\n  finishReason?: string;\n  warnings?: Array\u003C{\n    type: string;\n    message: string\n  }>;\n  experimental_providerMetadata?: Record\u003Cstring, unknown>;\n}\n",[12322],{"type":40,"tag":54,"props":12323,"children":12324},{"__ignoreMap":133},[12325,12341,12372,12388,12409,12429,12449,12457,12477,12497,12516,12531,12538,12576],{"type":40,"tag":139,"props":12326,"children":12327},{"class":141,"line":142},[12328,12332,12337],{"type":40,"tag":139,"props":12329,"children":12330},{"style":299},[12331],{"type":45,"value":11435},{"type":40,"tag":139,"props":12333,"children":12334},{"style":156},[12335],{"type":45,"value":12336}," OpenResponsesNonStreamingResponse",{"type":40,"tag":139,"props":12338,"children":12339},{"style":248},[12340],{"type":45,"value":1436},{"type":40,"tag":139,"props":12342,"children":12343},{"class":141,"line":152},[12344,12349,12353,12357,12362,12367],{"type":40,"tag":139,"props":12345,"children":12346},{"style":338},[12347],{"type":45,"value":12348},"  output",{"type":40,"tag":139,"props":12350,"children":12351},{"style":248},[12352],{"type":45,"value":346},{"type":40,"tag":139,"props":12354,"children":12355},{"style":156},[12356],{"type":45,"value":11594},{"type":40,"tag":139,"props":12358,"children":12359},{"style":248},[12360],{"type":45,"value":12361},"\u003C",{"type":40,"tag":139,"props":12363,"children":12364},{"style":156},[12365],{"type":45,"value":12366},"ResponseMessage",{"type":40,"tag":139,"props":12368,"children":12369},{"style":248},[12370],{"type":45,"value":12371},">;\n",{"type":40,"tag":139,"props":12373,"children":12374},{"class":141,"line":173},[12375,12380,12384],{"type":40,"tag":139,"props":12376,"children":12377},{"style":338},[12378],{"type":45,"value":12379},"  usage",{"type":40,"tag":139,"props":12381,"children":12382},{"style":248},[12383],{"type":45,"value":11715},{"type":40,"tag":139,"props":12385,"children":12386},{"style":248},[12387],{"type":45,"value":1436},{"type":40,"tag":139,"props":12389,"children":12390},{"class":141,"line":183},[12391,12396,12400,12405],{"type":40,"tag":139,"props":12392,"children":12393},{"style":338},[12394],{"type":45,"value":12395},"    inputTokens",{"type":40,"tag":139,"props":12397,"children":12398},{"style":248},[12399],{"type":45,"value":346},{"type":40,"tag":139,"props":12401,"children":12402},{"style":156},[12403],{"type":45,"value":12404}," number",{"type":40,"tag":139,"props":12406,"children":12407},{"style":248},[12408],{"type":45,"value":286},{"type":40,"tag":139,"props":12410,"children":12411},{"class":141,"line":192},[12412,12417,12421,12425],{"type":40,"tag":139,"props":12413,"children":12414},{"style":338},[12415],{"type":45,"value":12416},"    outputTokens",{"type":40,"tag":139,"props":12418,"children":12419},{"style":248},[12420],{"type":45,"value":346},{"type":40,"tag":139,"props":12422,"children":12423},{"style":156},[12424],{"type":45,"value":12404},{"type":40,"tag":139,"props":12426,"children":12427},{"style":248},[12428],{"type":45,"value":286},{"type":40,"tag":139,"props":12430,"children":12431},{"class":141,"line":995},[12432,12437,12441,12445],{"type":40,"tag":139,"props":12433,"children":12434},{"style":338},[12435],{"type":45,"value":12436},"    cachedTokens",{"type":40,"tag":139,"props":12438,"children":12439},{"style":248},[12440],{"type":45,"value":11715},{"type":40,"tag":139,"props":12442,"children":12443},{"style":156},[12444],{"type":45,"value":12404},{"type":40,"tag":139,"props":12446,"children":12447},{"style":248},[12448],{"type":45,"value":286},{"type":40,"tag":139,"props":12450,"children":12451},{"class":141,"line":1213},[12452],{"type":40,"tag":139,"props":12453,"children":12454},{"style":248},[12455],{"type":45,"value":12456},"  };\n",{"type":40,"tag":139,"props":12458,"children":12459},{"class":141,"line":1229},[12460,12465,12469,12473],{"type":40,"tag":139,"props":12461,"children":12462},{"style":338},[12463],{"type":45,"value":12464},"  finishReason",{"type":40,"tag":139,"props":12466,"children":12467},{"style":248},[12468],{"type":45,"value":11715},{"type":40,"tag":139,"props":12470,"children":12471},{"style":156},[12472],{"type":45,"value":11506},{"type":40,"tag":139,"props":12474,"children":12475},{"style":248},[12476],{"type":45,"value":286},{"type":40,"tag":139,"props":12478,"children":12479},{"class":141,"line":1237},[12480,12485,12489,12493],{"type":40,"tag":139,"props":12481,"children":12482},{"style":338},[12483],{"type":45,"value":12484},"  warnings",{"type":40,"tag":139,"props":12486,"children":12487},{"style":248},[12488],{"type":45,"value":11715},{"type":40,"tag":139,"props":12490,"children":12491},{"style":156},[12492],{"type":45,"value":11594},{"type":40,"tag":139,"props":12494,"children":12495},{"style":248},[12496],{"type":45,"value":12057},{"type":40,"tag":139,"props":12498,"children":12499},{"class":141,"line":1246},[12500,12504,12508,12512],{"type":40,"tag":139,"props":12501,"children":12502},{"style":338},[12503],{"type":45,"value":7392},{"type":40,"tag":139,"props":12505,"children":12506},{"style":248},[12507],{"type":45,"value":346},{"type":40,"tag":139,"props":12509,"children":12510},{"style":156},[12511],{"type":45,"value":11506},{"type":40,"tag":139,"props":12513,"children":12514},{"style":248},[12515],{"type":45,"value":286},{"type":40,"tag":139,"props":12517,"children":12518},{"class":141,"line":1296},[12519,12523,12527],{"type":40,"tag":139,"props":12520,"children":12521},{"style":338},[12522],{"type":45,"value":7442},{"type":40,"tag":139,"props":12524,"children":12525},{"style":248},[12526],{"type":45,"value":346},{"type":40,"tag":139,"props":12528,"children":12529},{"style":156},[12530],{"type":45,"value":3220},{"type":40,"tag":139,"props":12532,"children":12533},{"class":141,"line":1322},[12534],{"type":40,"tag":139,"props":12535,"children":12536},{"style":248},[12537],{"type":45,"value":12181},{"type":40,"tag":139,"props":12539,"children":12540},{"class":141,"line":1338},[12541,12546,12550,12555,12559,12563,12567,12572],{"type":40,"tag":139,"props":12542,"children":12543},{"style":338},[12544],{"type":45,"value":12545},"  experimental_providerMetadata",{"type":40,"tag":139,"props":12547,"children":12548},{"style":248},[12549],{"type":45,"value":11715},{"type":40,"tag":139,"props":12551,"children":12552},{"style":156},[12553],{"type":45,"value":12554}," Record",{"type":40,"tag":139,"props":12556,"children":12557},{"style":248},[12558],{"type":45,"value":12361},{"type":40,"tag":139,"props":12560,"children":12561},{"style":156},[12562],{"type":45,"value":1858},{"type":40,"tag":139,"props":12564,"children":12565},{"style":248},[12566],{"type":45,"value":974},{"type":40,"tag":139,"props":12568,"children":12569},{"style":156},[12570],{"type":45,"value":12571}," unknown",{"type":40,"tag":139,"props":12573,"children":12574},{"style":248},[12575],{"type":45,"value":12371},{"type":40,"tag":139,"props":12577,"children":12578},{"class":141,"line":1346},[12579],{"type":40,"tag":139,"props":12580,"children":12581},{"style":248},[12582],{"type":45,"value":5988},{"type":40,"tag":403,"props":12584,"children":12586},{"id":12585},"response-message-types",[12587],{"type":45,"value":12588},"Response Message Types",{"type":40,"tag":48,"props":12590,"children":12591},{},[12592],{"type":45,"value":12593},"Output messages in the response array:",{"type":40,"tag":128,"props":12595,"children":12597},{"className":231,"code":12596,"language":19,"meta":133,"style":133},"\u002F\u002F Text\u002Fcontent message\ninterface ResponseOutputMessage {\n  type: 'message';\n  role: 'assistant';\n  content: string | Array\u003CContentPart>;\n  reasoning?: string;  \u002F\u002F For reasoning models (o1, etc.)\n}\n\n\u002F\u002F Tool result in output\ninterface FunctionCallOutputMessage {\n  type: 'function_call_output';\n  call_id: string;\n  output: string;\n}\n",[12598],{"type":40,"tag":54,"props":12599,"children":12600},{"__ignoreMap":133},[12601,12609,12625,12654,12681,12717,12742,12749,12756,12764,12780,12808,12828,12847],{"type":40,"tag":139,"props":12602,"children":12603},{"class":141,"line":142},[12604],{"type":40,"tag":139,"props":12605,"children":12606},{"style":146},[12607],{"type":45,"value":12608},"\u002F\u002F Text\u002Fcontent message\n",{"type":40,"tag":139,"props":12610,"children":12611},{"class":141,"line":152},[12612,12616,12621],{"type":40,"tag":139,"props":12613,"children":12614},{"style":299},[12615],{"type":45,"value":11435},{"type":40,"tag":139,"props":12617,"children":12618},{"style":156},[12619],{"type":45,"value":12620}," ResponseOutputMessage",{"type":40,"tag":139,"props":12622,"children":12623},{"style":248},[12624],{"type":45,"value":1436},{"type":40,"tag":139,"props":12626,"children":12627},{"class":141,"line":173},[12628,12633,12637,12641,12646,12650],{"type":40,"tag":139,"props":12629,"children":12630},{"style":338},[12631],{"type":45,"value":12632},"  type",{"type":40,"tag":139,"props":12634,"children":12635},{"style":248},[12636],{"type":45,"value":346},{"type":40,"tag":139,"props":12638,"children":12639},{"style":248},[12640],{"type":45,"value":272},{"type":40,"tag":139,"props":12642,"children":12643},{"style":162},[12644],{"type":45,"value":12645},"message",{"type":40,"tag":139,"props":12647,"children":12648},{"style":248},[12649],{"type":45,"value":281},{"type":40,"tag":139,"props":12651,"children":12652},{"style":248},[12653],{"type":45,"value":286},{"type":40,"tag":139,"props":12655,"children":12656},{"class":141,"line":183},[12657,12661,12665,12669,12673,12677],{"type":40,"tag":139,"props":12658,"children":12659},{"style":338},[12660],{"type":45,"value":11452},{"type":40,"tag":139,"props":12662,"children":12663},{"style":248},[12664],{"type":45,"value":346},{"type":40,"tag":139,"props":12666,"children":12667},{"style":248},[12668],{"type":45,"value":272},{"type":40,"tag":139,"props":12670,"children":12671},{"style":162},[12672],{"type":45,"value":4608},{"type":40,"tag":139,"props":12674,"children":12675},{"style":248},[12676],{"type":45,"value":281},{"type":40,"tag":139,"props":12678,"children":12679},{"style":248},[12680],{"type":45,"value":286},{"type":40,"tag":139,"props":12682,"children":12683},{"class":141,"line":192},[12684,12688,12692,12696,12700,12704,12708,12713],{"type":40,"tag":139,"props":12685,"children":12686},{"style":338},[12687],{"type":45,"value":11497},{"type":40,"tag":139,"props":12689,"children":12690},{"style":248},[12691],{"type":45,"value":346},{"type":40,"tag":139,"props":12693,"children":12694},{"style":156},[12695],{"type":45,"value":11506},{"type":40,"tag":139,"props":12697,"children":12698},{"style":248},[12699],{"type":45,"value":11473},{"type":40,"tag":139,"props":12701,"children":12702},{"style":156},[12703],{"type":45,"value":11594},{"type":40,"tag":139,"props":12705,"children":12706},{"style":248},[12707],{"type":45,"value":12361},{"type":40,"tag":139,"props":12709,"children":12710},{"style":156},[12711],{"type":45,"value":12712},"ContentPart",{"type":40,"tag":139,"props":12714,"children":12715},{"style":248},[12716],{"type":45,"value":12371},{"type":40,"tag":139,"props":12718,"children":12719},{"class":141,"line":995},[12720,12725,12729,12733,12737],{"type":40,"tag":139,"props":12721,"children":12722},{"style":338},[12723],{"type":45,"value":12724},"  reasoning",{"type":40,"tag":139,"props":12726,"children":12727},{"style":248},[12728],{"type":45,"value":11715},{"type":40,"tag":139,"props":12730,"children":12731},{"style":156},[12732],{"type":45,"value":11506},{"type":40,"tag":139,"props":12734,"children":12735},{"style":248},[12736],{"type":45,"value":2056},{"type":40,"tag":139,"props":12738,"children":12739},{"style":146},[12740],{"type":45,"value":12741},"  \u002F\u002F For reasoning models (o1, etc.)\n",{"type":40,"tag":139,"props":12743,"children":12744},{"class":141,"line":1213},[12745],{"type":40,"tag":139,"props":12746,"children":12747},{"style":248},[12748],{"type":45,"value":5988},{"type":40,"tag":139,"props":12750,"children":12751},{"class":141,"line":1229},[12752],{"type":40,"tag":139,"props":12753,"children":12754},{"emptyLinePlaceholder":177},[12755],{"type":45,"value":180},{"type":40,"tag":139,"props":12757,"children":12758},{"class":141,"line":1237},[12759],{"type":40,"tag":139,"props":12760,"children":12761},{"style":146},[12762],{"type":45,"value":12763},"\u002F\u002F Tool result in output\n",{"type":40,"tag":139,"props":12765,"children":12766},{"class":141,"line":1246},[12767,12771,12776],{"type":40,"tag":139,"props":12768,"children":12769},{"style":299},[12770],{"type":45,"value":11435},{"type":40,"tag":139,"props":12772,"children":12773},{"style":156},[12774],{"type":45,"value":12775}," FunctionCallOutputMessage",{"type":40,"tag":139,"props":12777,"children":12778},{"style":248},[12779],{"type":45,"value":1436},{"type":40,"tag":139,"props":12781,"children":12782},{"class":141,"line":1296},[12783,12787,12791,12795,12800,12804],{"type":40,"tag":139,"props":12784,"children":12785},{"style":338},[12786],{"type":45,"value":12632},{"type":40,"tag":139,"props":12788,"children":12789},{"style":248},[12790],{"type":45,"value":346},{"type":40,"tag":139,"props":12792,"children":12793},{"style":248},[12794],{"type":45,"value":272},{"type":40,"tag":139,"props":12796,"children":12797},{"style":162},[12798],{"type":45,"value":12799},"function_call_output",{"type":40,"tag":139,"props":12801,"children":12802},{"style":248},[12803],{"type":45,"value":281},{"type":40,"tag":139,"props":12805,"children":12806},{"style":248},[12807],{"type":45,"value":286},{"type":40,"tag":139,"props":12809,"children":12810},{"class":141,"line":1322},[12811,12816,12820,12824],{"type":40,"tag":139,"props":12812,"children":12813},{"style":338},[12814],{"type":45,"value":12815},"  call_id",{"type":40,"tag":139,"props":12817,"children":12818},{"style":248},[12819],{"type":45,"value":346},{"type":40,"tag":139,"props":12821,"children":12822},{"style":156},[12823],{"type":45,"value":11506},{"type":40,"tag":139,"props":12825,"children":12826},{"style":248},[12827],{"type":45,"value":286},{"type":40,"tag":139,"props":12829,"children":12830},{"class":141,"line":1338},[12831,12835,12839,12843],{"type":40,"tag":139,"props":12832,"children":12833},{"style":338},[12834],{"type":45,"value":12348},{"type":40,"tag":139,"props":12836,"children":12837},{"style":248},[12838],{"type":45,"value":346},{"type":40,"tag":139,"props":12840,"children":12841},{"style":156},[12842],{"type":45,"value":11506},{"type":40,"tag":139,"props":12844,"children":12845},{"style":248},[12846],{"type":45,"value":286},{"type":40,"tag":139,"props":12848,"children":12849},{"class":141,"line":1346},[12850],{"type":40,"tag":139,"props":12851,"children":12852},{"style":248},[12853],{"type":45,"value":5988},{"type":40,"tag":403,"props":12855,"children":12857},{"id":12856},"parsed-tool-call",[12858],{"type":45,"value":12859},"Parsed Tool Call",{"type":40,"tag":48,"props":12861,"children":12862},{},[12863],{"type":45,"value":12864},"When tool calls are parsed from the response:",{"type":40,"tag":128,"props":12866,"children":12868},{"className":231,"code":12867,"language":19,"meta":133,"style":133},"interface ParsedToolCall {\n  id: string;\n  name: string;\n  arguments: unknown;  \u002F\u002F Validated against inputSchema\n}\n",[12869],{"type":40,"tag":54,"props":12870,"children":12871},{"__ignoreMap":133},[12872,12888,12908,12927,12952],{"type":40,"tag":139,"props":12873,"children":12874},{"class":141,"line":142},[12875,12879,12884],{"type":40,"tag":139,"props":12876,"children":12877},{"style":299},[12878],{"type":45,"value":11435},{"type":40,"tag":139,"props":12880,"children":12881},{"style":156},[12882],{"type":45,"value":12883}," ParsedToolCall",{"type":40,"tag":139,"props":12885,"children":12886},{"style":248},[12887],{"type":45,"value":1436},{"type":40,"tag":139,"props":12889,"children":12890},{"class":141,"line":152},[12891,12896,12900,12904],{"type":40,"tag":139,"props":12892,"children":12893},{"style":338},[12894],{"type":45,"value":12895},"  id",{"type":40,"tag":139,"props":12897,"children":12898},{"style":248},[12899],{"type":45,"value":346},{"type":40,"tag":139,"props":12901,"children":12902},{"style":156},[12903],{"type":45,"value":11506},{"type":40,"tag":139,"props":12905,"children":12906},{"style":248},[12907],{"type":45,"value":286},{"type":40,"tag":139,"props":12909,"children":12910},{"class":141,"line":173},[12911,12915,12919,12923],{"type":40,"tag":139,"props":12912,"children":12913},{"style":338},[12914],{"type":45,"value":1193},{"type":40,"tag":139,"props":12916,"children":12917},{"style":248},[12918],{"type":45,"value":346},{"type":40,"tag":139,"props":12920,"children":12921},{"style":156},[12922],{"type":45,"value":11506},{"type":40,"tag":139,"props":12924,"children":12925},{"style":248},[12926],{"type":45,"value":286},{"type":40,"tag":139,"props":12928,"children":12929},{"class":141,"line":183},[12930,12935,12939,12943,12947],{"type":40,"tag":139,"props":12931,"children":12932},{"style":338},[12933],{"type":45,"value":12934},"  arguments",{"type":40,"tag":139,"props":12936,"children":12937},{"style":248},[12938],{"type":45,"value":346},{"type":40,"tag":139,"props":12940,"children":12941},{"style":156},[12942],{"type":45,"value":12571},{"type":40,"tag":139,"props":12944,"children":12945},{"style":248},[12946],{"type":45,"value":2056},{"type":40,"tag":139,"props":12948,"children":12949},{"style":146},[12950],{"type":45,"value":12951},"  \u002F\u002F Validated against inputSchema\n",{"type":40,"tag":139,"props":12953,"children":12954},{"class":141,"line":192},[12955],{"type":40,"tag":139,"props":12956,"children":12957},{"style":248},[12958],{"type":45,"value":5988},{"type":40,"tag":403,"props":12960,"children":12962},{"id":12961},"tool-execution-result",[12963],{"type":45,"value":12964},"Tool Execution Result",{"type":40,"tag":48,"props":12966,"children":12967},{},[12968],{"type":45,"value":12969},"After a tool completes execution:",{"type":40,"tag":128,"props":12971,"children":12973},{"className":231,"code":12972,"language":19,"meta":133,"style":133},"interface ToolExecutionResult {\n  toolCallId: string;\n  toolName: string;\n  result: unknown;                  \u002F\u002F Validated against outputSchema\n  preliminaryResults?: unknown[];   \u002F\u002F From generator tools\n  error?: Error;\n}\n",[12974],{"type":40,"tag":54,"props":12975,"children":12976},{"__ignoreMap":133},[12977,12993,13013,13033,13058,13088,13109],{"type":40,"tag":139,"props":12978,"children":12979},{"class":141,"line":142},[12980,12984,12989],{"type":40,"tag":139,"props":12981,"children":12982},{"style":299},[12983],{"type":45,"value":11435},{"type":40,"tag":139,"props":12985,"children":12986},{"style":156},[12987],{"type":45,"value":12988}," ToolExecutionResult",{"type":40,"tag":139,"props":12990,"children":12991},{"style":248},[12992],{"type":45,"value":1436},{"type":40,"tag":139,"props":12994,"children":12995},{"class":141,"line":152},[12996,13001,13005,13009],{"type":40,"tag":139,"props":12997,"children":12998},{"style":338},[12999],{"type":45,"value":13000},"  toolCallId",{"type":40,"tag":139,"props":13002,"children":13003},{"style":248},[13004],{"type":45,"value":346},{"type":40,"tag":139,"props":13006,"children":13007},{"style":156},[13008],{"type":45,"value":11506},{"type":40,"tag":139,"props":13010,"children":13011},{"style":248},[13012],{"type":45,"value":286},{"type":40,"tag":139,"props":13014,"children":13015},{"class":141,"line":173},[13016,13021,13025,13029],{"type":40,"tag":139,"props":13017,"children":13018},{"style":338},[13019],{"type":45,"value":13020},"  toolName",{"type":40,"tag":139,"props":13022,"children":13023},{"style":248},[13024],{"type":45,"value":346},{"type":40,"tag":139,"props":13026,"children":13027},{"style":156},[13028],{"type":45,"value":11506},{"type":40,"tag":139,"props":13030,"children":13031},{"style":248},[13032],{"type":45,"value":286},{"type":40,"tag":139,"props":13034,"children":13035},{"class":141,"line":183},[13036,13041,13045,13049,13053],{"type":40,"tag":139,"props":13037,"children":13038},{"style":338},[13039],{"type":45,"value":13040},"  result",{"type":40,"tag":139,"props":13042,"children":13043},{"style":248},[13044],{"type":45,"value":346},{"type":40,"tag":139,"props":13046,"children":13047},{"style":156},[13048],{"type":45,"value":12571},{"type":40,"tag":139,"props":13050,"children":13051},{"style":248},[13052],{"type":45,"value":2056},{"type":40,"tag":139,"props":13054,"children":13055},{"style":146},[13056],{"type":45,"value":13057},"                  \u002F\u002F Validated against outputSchema\n",{"type":40,"tag":139,"props":13059,"children":13060},{"class":141,"line":192},[13061,13066,13070,13074,13079,13083],{"type":40,"tag":139,"props":13062,"children":13063},{"style":338},[13064],{"type":45,"value":13065},"  preliminaryResults",{"type":40,"tag":139,"props":13067,"children":13068},{"style":248},[13069],{"type":45,"value":11715},{"type":40,"tag":139,"props":13071,"children":13072},{"style":156},[13073],{"type":45,"value":12571},{"type":40,"tag":139,"props":13075,"children":13076},{"style":254},[13077],{"type":45,"value":13078},"[]",{"type":40,"tag":139,"props":13080,"children":13081},{"style":248},[13082],{"type":45,"value":2056},{"type":40,"tag":139,"props":13084,"children":13085},{"style":146},[13086],{"type":45,"value":13087},"   \u002F\u002F From generator tools\n",{"type":40,"tag":139,"props":13089,"children":13090},{"class":141,"line":995},[13091,13096,13100,13105],{"type":40,"tag":139,"props":13092,"children":13093},{"style":338},[13094],{"type":45,"value":13095},"  error",{"type":40,"tag":139,"props":13097,"children":13098},{"style":248},[13099],{"type":45,"value":11715},{"type":40,"tag":139,"props":13101,"children":13102},{"style":156},[13103],{"type":45,"value":13104}," Error",{"type":40,"tag":139,"props":13106,"children":13107},{"style":248},[13108],{"type":45,"value":286},{"type":40,"tag":139,"props":13110,"children":13111},{"class":141,"line":1213},[13112],{"type":40,"tag":139,"props":13113,"children":13114},{"style":248},[13115],{"type":45,"value":5988},{"type":40,"tag":403,"props":13117,"children":13119},{"id":13118},"step-result-for-stop-conditions",[13120],{"type":45,"value":13121},"Step Result (for Stop Conditions)",{"type":40,"tag":48,"props":13123,"children":13124},{},[13125],{"type":45,"value":13126},"Available in custom stop condition callbacks:",{"type":40,"tag":128,"props":13128,"children":13130},{"className":231,"code":13129,"language":19,"meta":133,"style":133},"interface StepResult {\n  stepType: 'initial' | 'continue';\n  text: string;\n  toolCalls: ParsedToolCall[];\n  toolResults: ToolExecutionResult[];\n  response: OpenResponsesNonStreamingResponse;\n  usage?: {\n    inputTokens: number;\n    outputTokens: number;\n    cachedTokens?: number;\n  };\n  finishReason?: string;\n  warnings?: Array\u003C{ type: string; message: string }>;\n  experimental_providerMetadata?: Record\u003Cstring, unknown>;\n}\n",[13131],{"type":40,"tag":54,"props":13132,"children":13133},{"__ignoreMap":133},[13134,13150,13196,13216,13240,13264,13284,13299,13318,13337,13356,13363,13382,13435,13470],{"type":40,"tag":139,"props":13135,"children":13136},{"class":141,"line":142},[13137,13141,13146],{"type":40,"tag":139,"props":13138,"children":13139},{"style":299},[13140],{"type":45,"value":11435},{"type":40,"tag":139,"props":13142,"children":13143},{"style":156},[13144],{"type":45,"value":13145}," StepResult",{"type":40,"tag":139,"props":13147,"children":13148},{"style":248},[13149],{"type":45,"value":1436},{"type":40,"tag":139,"props":13151,"children":13152},{"class":141,"line":152},[13153,13158,13162,13166,13171,13175,13179,13183,13188,13192],{"type":40,"tag":139,"props":13154,"children":13155},{"style":338},[13156],{"type":45,"value":13157},"  stepType",{"type":40,"tag":139,"props":13159,"children":13160},{"style":248},[13161],{"type":45,"value":346},{"type":40,"tag":139,"props":13163,"children":13164},{"style":248},[13165],{"type":45,"value":272},{"type":40,"tag":139,"props":13167,"children":13168},{"style":162},[13169],{"type":45,"value":13170},"initial",{"type":40,"tag":139,"props":13172,"children":13173},{"style":248},[13174],{"type":45,"value":281},{"type":40,"tag":139,"props":13176,"children":13177},{"style":248},[13178],{"type":45,"value":11473},{"type":40,"tag":139,"props":13180,"children":13181},{"style":248},[13182],{"type":45,"value":272},{"type":40,"tag":139,"props":13184,"children":13185},{"style":162},[13186],{"type":45,"value":13187},"continue",{"type":40,"tag":139,"props":13189,"children":13190},{"style":248},[13191],{"type":45,"value":281},{"type":40,"tag":139,"props":13193,"children":13194},{"style":248},[13195],{"type":45,"value":286},{"type":40,"tag":139,"props":13197,"children":13198},{"class":141,"line":173},[13199,13204,13208,13212],{"type":40,"tag":139,"props":13200,"children":13201},{"style":338},[13202],{"type":45,"value":13203},"  text",{"type":40,"tag":139,"props":13205,"children":13206},{"style":248},[13207],{"type":45,"value":346},{"type":40,"tag":139,"props":13209,"children":13210},{"style":156},[13211],{"type":45,"value":11506},{"type":40,"tag":139,"props":13213,"children":13214},{"style":248},[13215],{"type":45,"value":286},{"type":40,"tag":139,"props":13217,"children":13218},{"class":141,"line":183},[13219,13224,13228,13232,13236],{"type":40,"tag":139,"props":13220,"children":13221},{"style":338},[13222],{"type":45,"value":13223},"  toolCalls",{"type":40,"tag":139,"props":13225,"children":13226},{"style":248},[13227],{"type":45,"value":346},{"type":40,"tag":139,"props":13229,"children":13230},{"style":156},[13231],{"type":45,"value":12883},{"type":40,"tag":139,"props":13233,"children":13234},{"style":254},[13235],{"type":45,"value":13078},{"type":40,"tag":139,"props":13237,"children":13238},{"style":248},[13239],{"type":45,"value":286},{"type":40,"tag":139,"props":13241,"children":13242},{"class":141,"line":192},[13243,13248,13252,13256,13260],{"type":40,"tag":139,"props":13244,"children":13245},{"style":338},[13246],{"type":45,"value":13247},"  toolResults",{"type":40,"tag":139,"props":13249,"children":13250},{"style":248},[13251],{"type":45,"value":346},{"type":40,"tag":139,"props":13253,"children":13254},{"style":156},[13255],{"type":45,"value":12988},{"type":40,"tag":139,"props":13257,"children":13258},{"style":254},[13259],{"type":45,"value":13078},{"type":40,"tag":139,"props":13261,"children":13262},{"style":248},[13263],{"type":45,"value":286},{"type":40,"tag":139,"props":13265,"children":13266},{"class":141,"line":995},[13267,13272,13276,13280],{"type":40,"tag":139,"props":13268,"children":13269},{"style":338},[13270],{"type":45,"value":13271},"  response",{"type":40,"tag":139,"props":13273,"children":13274},{"style":248},[13275],{"type":45,"value":346},{"type":40,"tag":139,"props":13277,"children":13278},{"style":156},[13279],{"type":45,"value":12336},{"type":40,"tag":139,"props":13281,"children":13282},{"style":248},[13283],{"type":45,"value":286},{"type":40,"tag":139,"props":13285,"children":13286},{"class":141,"line":1213},[13287,13291,13295],{"type":40,"tag":139,"props":13288,"children":13289},{"style":338},[13290],{"type":45,"value":12379},{"type":40,"tag":139,"props":13292,"children":13293},{"style":248},[13294],{"type":45,"value":11715},{"type":40,"tag":139,"props":13296,"children":13297},{"style":248},[13298],{"type":45,"value":1436},{"type":40,"tag":139,"props":13300,"children":13301},{"class":141,"line":1229},[13302,13306,13310,13314],{"type":40,"tag":139,"props":13303,"children":13304},{"style":338},[13305],{"type":45,"value":12395},{"type":40,"tag":139,"props":13307,"children":13308},{"style":248},[13309],{"type":45,"value":346},{"type":40,"tag":139,"props":13311,"children":13312},{"style":156},[13313],{"type":45,"value":12404},{"type":40,"tag":139,"props":13315,"children":13316},{"style":248},[13317],{"type":45,"value":286},{"type":40,"tag":139,"props":13319,"children":13320},{"class":141,"line":1237},[13321,13325,13329,13333],{"type":40,"tag":139,"props":13322,"children":13323},{"style":338},[13324],{"type":45,"value":12416},{"type":40,"tag":139,"props":13326,"children":13327},{"style":248},[13328],{"type":45,"value":346},{"type":40,"tag":139,"props":13330,"children":13331},{"style":156},[13332],{"type":45,"value":12404},{"type":40,"tag":139,"props":13334,"children":13335},{"style":248},[13336],{"type":45,"value":286},{"type":40,"tag":139,"props":13338,"children":13339},{"class":141,"line":1246},[13340,13344,13348,13352],{"type":40,"tag":139,"props":13341,"children":13342},{"style":338},[13343],{"type":45,"value":12436},{"type":40,"tag":139,"props":13345,"children":13346},{"style":248},[13347],{"type":45,"value":11715},{"type":40,"tag":139,"props":13349,"children":13350},{"style":156},[13351],{"type":45,"value":12404},{"type":40,"tag":139,"props":13353,"children":13354},{"style":248},[13355],{"type":45,"value":286},{"type":40,"tag":139,"props":13357,"children":13358},{"class":141,"line":1296},[13359],{"type":40,"tag":139,"props":13360,"children":13361},{"style":248},[13362],{"type":45,"value":12456},{"type":40,"tag":139,"props":13364,"children":13365},{"class":141,"line":1322},[13366,13370,13374,13378],{"type":40,"tag":139,"props":13367,"children":13368},{"style":338},[13369],{"type":45,"value":12464},{"type":40,"tag":139,"props":13371,"children":13372},{"style":248},[13373],{"type":45,"value":11715},{"type":40,"tag":139,"props":13375,"children":13376},{"style":156},[13377],{"type":45,"value":11506},{"type":40,"tag":139,"props":13379,"children":13380},{"style":248},[13381],{"type":45,"value":286},{"type":40,"tag":139,"props":13383,"children":13384},{"class":141,"line":1338},[13385,13389,13393,13397,13402,13406,13410,13414,13418,13422,13426,13430],{"type":40,"tag":139,"props":13386,"children":13387},{"style":338},[13388],{"type":45,"value":12484},{"type":40,"tag":139,"props":13390,"children":13391},{"style":248},[13392],{"type":45,"value":11715},{"type":40,"tag":139,"props":13394,"children":13395},{"style":156},[13396],{"type":45,"value":11594},{"type":40,"tag":139,"props":13398,"children":13399},{"style":248},[13400],{"type":45,"value":13401},"\u003C{",{"type":40,"tag":139,"props":13403,"children":13404},{"style":338},[13405],{"type":45,"value":4881},{"type":40,"tag":139,"props":13407,"children":13408},{"style":248},[13409],{"type":45,"value":346},{"type":40,"tag":139,"props":13411,"children":13412},{"style":156},[13413],{"type":45,"value":11506},{"type":40,"tag":139,"props":13415,"children":13416},{"style":248},[13417],{"type":45,"value":2056},{"type":40,"tag":139,"props":13419,"children":13420},{"style":338},[13421],{"type":45,"value":7641},{"type":40,"tag":139,"props":13423,"children":13424},{"style":248},[13425],{"type":45,"value":346},{"type":40,"tag":139,"props":13427,"children":13428},{"style":156},[13429],{"type":45,"value":11506},{"type":40,"tag":139,"props":13431,"children":13432},{"style":248},[13433],{"type":45,"value":13434}," }>;\n",{"type":40,"tag":139,"props":13436,"children":13437},{"class":141,"line":1346},[13438,13442,13446,13450,13454,13458,13462,13466],{"type":40,"tag":139,"props":13439,"children":13440},{"style":338},[13441],{"type":45,"value":12545},{"type":40,"tag":139,"props":13443,"children":13444},{"style":248},[13445],{"type":45,"value":11715},{"type":40,"tag":139,"props":13447,"children":13448},{"style":156},[13449],{"type":45,"value":12554},{"type":40,"tag":139,"props":13451,"children":13452},{"style":248},[13453],{"type":45,"value":12361},{"type":40,"tag":139,"props":13455,"children":13456},{"style":156},[13457],{"type":45,"value":1858},{"type":40,"tag":139,"props":13459,"children":13460},{"style":248},[13461],{"type":45,"value":974},{"type":40,"tag":139,"props":13463,"children":13464},{"style":156},[13465],{"type":45,"value":12571},{"type":40,"tag":139,"props":13467,"children":13468},{"style":248},[13469],{"type":45,"value":12371},{"type":40,"tag":139,"props":13471,"children":13472},{"class":141,"line":1355},[13473],{"type":40,"tag":139,"props":13474,"children":13475},{"style":248},[13476],{"type":45,"value":5988},{"type":40,"tag":403,"props":13478,"children":13480},{"id":13479},"turncontext",[13481],{"type":45,"value":13482},"TurnContext",{"type":40,"tag":48,"props":13484,"children":13485},{},[13486],{"type":45,"value":13487},"Available to tools and dynamic parameter functions:",{"type":40,"tag":128,"props":13489,"children":13491},{"className":231,"code":13490,"language":19,"meta":133,"style":133},"interface TurnContext {\n  numberOfTurns: number;                     \u002F\u002F Turn count (1-indexed)\n  turnRequest?: OpenResponsesRequest;        \u002F\u002F Current request being made\n  toolCall?: OpenResponsesFunctionToolCall;  \u002F\u002F Current tool call (in tool context)\n}\n",[13492],{"type":40,"tag":54,"props":13493,"children":13494},{"__ignoreMap":133},[13495,13511,13536,13562,13588],{"type":40,"tag":139,"props":13496,"children":13497},{"class":141,"line":142},[13498,13502,13507],{"type":40,"tag":139,"props":13499,"children":13500},{"style":299},[13501],{"type":45,"value":11435},{"type":40,"tag":139,"props":13503,"children":13504},{"style":156},[13505],{"type":45,"value":13506}," TurnContext",{"type":40,"tag":139,"props":13508,"children":13509},{"style":248},[13510],{"type":45,"value":1436},{"type":40,"tag":139,"props":13512,"children":13513},{"class":141,"line":152},[13514,13519,13523,13527,13531],{"type":40,"tag":139,"props":13515,"children":13516},{"style":338},[13517],{"type":45,"value":13518},"  numberOfTurns",{"type":40,"tag":139,"props":13520,"children":13521},{"style":248},[13522],{"type":45,"value":346},{"type":40,"tag":139,"props":13524,"children":13525},{"style":156},[13526],{"type":45,"value":12404},{"type":40,"tag":139,"props":13528,"children":13529},{"style":248},[13530],{"type":45,"value":2056},{"type":40,"tag":139,"props":13532,"children":13533},{"style":146},[13534],{"type":45,"value":13535},"                     \u002F\u002F Turn count (1-indexed)\n",{"type":40,"tag":139,"props":13537,"children":13538},{"class":141,"line":173},[13539,13544,13548,13553,13557],{"type":40,"tag":139,"props":13540,"children":13541},{"style":338},[13542],{"type":45,"value":13543},"  turnRequest",{"type":40,"tag":139,"props":13545,"children":13546},{"style":248},[13547],{"type":45,"value":11715},{"type":40,"tag":139,"props":13549,"children":13550},{"style":156},[13551],{"type":45,"value":13552}," OpenResponsesRequest",{"type":40,"tag":139,"props":13554,"children":13555},{"style":248},[13556],{"type":45,"value":2056},{"type":40,"tag":139,"props":13558,"children":13559},{"style":146},[13560],{"type":45,"value":13561},"        \u002F\u002F Current request being made\n",{"type":40,"tag":139,"props":13563,"children":13564},{"class":141,"line":183},[13565,13570,13574,13579,13583],{"type":40,"tag":139,"props":13566,"children":13567},{"style":338},[13568],{"type":45,"value":13569},"  toolCall",{"type":40,"tag":139,"props":13571,"children":13572},{"style":248},[13573],{"type":45,"value":11715},{"type":40,"tag":139,"props":13575,"children":13576},{"style":156},[13577],{"type":45,"value":13578}," OpenResponsesFunctionToolCall",{"type":40,"tag":139,"props":13580,"children":13581},{"style":248},[13582],{"type":45,"value":2056},{"type":40,"tag":139,"props":13584,"children":13585},{"style":146},[13586],{"type":45,"value":13587},"  \u002F\u002F Current tool call (in tool context)\n",{"type":40,"tag":139,"props":13589,"children":13590},{"class":141,"line":192},[13591],{"type":40,"tag":139,"props":13592,"children":13593},{"style":248},[13594],{"type":45,"value":5988},{"type":40,"tag":117,"props":13596,"children":13597},{},[],{"type":40,"tag":121,"props":13599,"children":13601},{"id":13600},"event-shapes",[13602],{"type":45,"value":13603},"Event Shapes",{"type":40,"tag":48,"props":13605,"children":13606},{},[13607],{"type":45,"value":13608},"The SDK provides multiple streaming methods that yield different event types.",{"type":40,"tag":403,"props":13610,"children":13612},{"id":13611},"response-stream-events",[13613],{"type":45,"value":13614},"Response Stream Events",{"type":40,"tag":48,"props":13616,"children":13617},{},[13618,13619,13625],{"type":45,"value":4065},{"type":40,"tag":54,"props":13620,"children":13622},{"className":13621},[],[13623],{"type":45,"value":13624},"getFullResponsesStream()",{"type":45,"value":13626}," method yields these event types:",{"type":40,"tag":128,"props":13628,"children":13630},{"className":231,"code":13629,"language":19,"meta":133,"style":133},"type EnhancedResponseStreamEvent =\n  | ResponseCreatedEvent\n  | ResponseInProgressEvent\n  | OutputTextDeltaEvent\n  | OutputTextDoneEvent\n  | ReasoningDeltaEvent\n  | ReasoningDoneEvent\n  | FunctionCallArgumentsDeltaEvent\n  | FunctionCallArgumentsDoneEvent\n  | ResponseCompletedEvent\n  | ToolPreliminaryResultEvent;\n",[13631],{"type":40,"tag":54,"props":13632,"children":13633},{"__ignoreMap":133},[13634,13652,13665,13677,13689,13701,13713,13725,13737,13749,13761],{"type":40,"tag":139,"props":13635,"children":13636},{"class":141,"line":142},[13637,13642,13647],{"type":40,"tag":139,"props":13638,"children":13639},{"style":299},[13640],{"type":45,"value":13641},"type",{"type":40,"tag":139,"props":13643,"children":13644},{"style":156},[13645],{"type":45,"value":13646}," EnhancedResponseStreamEvent",{"type":40,"tag":139,"props":13648,"children":13649},{"style":248},[13650],{"type":45,"value":13651}," =\n",{"type":40,"tag":139,"props":13653,"children":13654},{"class":141,"line":152},[13655,13660],{"type":40,"tag":139,"props":13656,"children":13657},{"style":248},[13658],{"type":45,"value":13659},"  |",{"type":40,"tag":139,"props":13661,"children":13662},{"style":156},[13663],{"type":45,"value":13664}," ResponseCreatedEvent\n",{"type":40,"tag":139,"props":13666,"children":13667},{"class":141,"line":173},[13668,13672],{"type":40,"tag":139,"props":13669,"children":13670},{"style":248},[13671],{"type":45,"value":13659},{"type":40,"tag":139,"props":13673,"children":13674},{"style":156},[13675],{"type":45,"value":13676}," ResponseInProgressEvent\n",{"type":40,"tag":139,"props":13678,"children":13679},{"class":141,"line":183},[13680,13684],{"type":40,"tag":139,"props":13681,"children":13682},{"style":248},[13683],{"type":45,"value":13659},{"type":40,"tag":139,"props":13685,"children":13686},{"style":156},[13687],{"type":45,"value":13688}," OutputTextDeltaEvent\n",{"type":40,"tag":139,"props":13690,"children":13691},{"class":141,"line":192},[13692,13696],{"type":40,"tag":139,"props":13693,"children":13694},{"style":248},[13695],{"type":45,"value":13659},{"type":40,"tag":139,"props":13697,"children":13698},{"style":156},[13699],{"type":45,"value":13700}," OutputTextDoneEvent\n",{"type":40,"tag":139,"props":13702,"children":13703},{"class":141,"line":995},[13704,13708],{"type":40,"tag":139,"props":13705,"children":13706},{"style":248},[13707],{"type":45,"value":13659},{"type":40,"tag":139,"props":13709,"children":13710},{"style":156},[13711],{"type":45,"value":13712}," ReasoningDeltaEvent\n",{"type":40,"tag":139,"props":13714,"children":13715},{"class":141,"line":1213},[13716,13720],{"type":40,"tag":139,"props":13717,"children":13718},{"style":248},[13719],{"type":45,"value":13659},{"type":40,"tag":139,"props":13721,"children":13722},{"style":156},[13723],{"type":45,"value":13724}," ReasoningDoneEvent\n",{"type":40,"tag":139,"props":13726,"children":13727},{"class":141,"line":1229},[13728,13732],{"type":40,"tag":139,"props":13729,"children":13730},{"style":248},[13731],{"type":45,"value":13659},{"type":40,"tag":139,"props":13733,"children":13734},{"style":156},[13735],{"type":45,"value":13736}," FunctionCallArgumentsDeltaEvent\n",{"type":40,"tag":139,"props":13738,"children":13739},{"class":141,"line":1237},[13740,13744],{"type":40,"tag":139,"props":13741,"children":13742},{"style":248},[13743],{"type":45,"value":13659},{"type":40,"tag":139,"props":13745,"children":13746},{"style":156},[13747],{"type":45,"value":13748}," FunctionCallArgumentsDoneEvent\n",{"type":40,"tag":139,"props":13750,"children":13751},{"class":141,"line":1246},[13752,13756],{"type":40,"tag":139,"props":13753,"children":13754},{"style":248},[13755],{"type":45,"value":13659},{"type":40,"tag":139,"props":13757,"children":13758},{"style":156},[13759],{"type":45,"value":13760}," ResponseCompletedEvent\n",{"type":40,"tag":139,"props":13762,"children":13763},{"class":141,"line":1296},[13764,13768,13773],{"type":40,"tag":139,"props":13765,"children":13766},{"style":248},[13767],{"type":45,"value":13659},{"type":40,"tag":139,"props":13769,"children":13770},{"style":156},[13771],{"type":45,"value":13772}," ToolPreliminaryResultEvent",{"type":40,"tag":139,"props":13774,"children":13775},{"style":248},[13776],{"type":45,"value":286},{"type":40,"tag":403,"props":13778,"children":13780},{"id":13779},"event-type-reference",[13781],{"type":45,"value":13782},"Event Type Reference",{"type":40,"tag":1801,"props":13784,"children":13785},{},[13786,13806],{"type":40,"tag":1805,"props":13787,"children":13788},{},[13789],{"type":40,"tag":1809,"props":13790,"children":13791},{},[13792,13797,13801],{"type":40,"tag":1813,"props":13793,"children":13794},{},[13795],{"type":45,"value":13796},"Event Type",{"type":40,"tag":1813,"props":13798,"children":13799},{},[13800],{"type":45,"value":1832},{"type":40,"tag":1813,"props":13802,"children":13803},{},[13804],{"type":45,"value":13805},"Payload",{"type":40,"tag":1834,"props":13807,"children":13808},{},[13809,13835,13861,13887,13913,13938,13964,13989,14015,14040],{"type":40,"tag":1809,"props":13810,"children":13811},{},[13812,13821,13826],{"type":40,"tag":1841,"props":13813,"children":13814},{},[13815],{"type":40,"tag":54,"props":13816,"children":13818},{"className":13817},[],[13819],{"type":45,"value":13820},"response.created",{"type":40,"tag":1841,"props":13822,"children":13823},{},[13824],{"type":45,"value":13825},"Response object initialized",{"type":40,"tag":1841,"props":13827,"children":13828},{},[13829],{"type":40,"tag":54,"props":13830,"children":13832},{"className":13831},[],[13833],{"type":45,"value":13834},"{ response: ResponseObject }",{"type":40,"tag":1809,"props":13836,"children":13837},{},[13838,13847,13852],{"type":40,"tag":1841,"props":13839,"children":13840},{},[13841],{"type":40,"tag":54,"props":13842,"children":13844},{"className":13843},[],[13845],{"type":45,"value":13846},"response.in_progress",{"type":40,"tag":1841,"props":13848,"children":13849},{},[13850],{"type":45,"value":13851},"Generation has started",{"type":40,"tag":1841,"props":13853,"children":13854},{},[13855],{"type":40,"tag":54,"props":13856,"children":13858},{"className":13857},[],[13859],{"type":45,"value":13860},"{}",{"type":40,"tag":1809,"props":13862,"children":13863},{},[13864,13873,13878],{"type":40,"tag":1841,"props":13865,"children":13866},{},[13867],{"type":40,"tag":54,"props":13868,"children":13870},{"className":13869},[],[13871],{"type":45,"value":13872},"response.output_text.delta",{"type":40,"tag":1841,"props":13874,"children":13875},{},[13876],{"type":45,"value":13877},"Text chunk received",{"type":40,"tag":1841,"props":13879,"children":13880},{},[13881],{"type":40,"tag":54,"props":13882,"children":13884},{"className":13883},[],[13885],{"type":45,"value":13886},"{ delta: string }",{"type":40,"tag":1809,"props":13888,"children":13889},{},[13890,13899,13904],{"type":40,"tag":1841,"props":13891,"children":13892},{},[13893],{"type":40,"tag":54,"props":13894,"children":13896},{"className":13895},[],[13897],{"type":45,"value":13898},"response.output_text.done",{"type":40,"tag":1841,"props":13900,"children":13901},{},[13902],{"type":45,"value":13903},"Text generation complete",{"type":40,"tag":1841,"props":13905,"children":13906},{},[13907],{"type":40,"tag":54,"props":13908,"children":13910},{"className":13909},[],[13911],{"type":45,"value":13912},"{ text: string }",{"type":40,"tag":1809,"props":13914,"children":13915},{},[13916,13925,13930],{"type":40,"tag":1841,"props":13917,"children":13918},{},[13919],{"type":40,"tag":54,"props":13920,"children":13922},{"className":13921},[],[13923],{"type":45,"value":13924},"response.reasoning.delta",{"type":40,"tag":1841,"props":13926,"children":13927},{},[13928],{"type":45,"value":13929},"Reasoning chunk (o1 models)",{"type":40,"tag":1841,"props":13931,"children":13932},{},[13933],{"type":40,"tag":54,"props":13934,"children":13936},{"className":13935},[],[13937],{"type":45,"value":13886},{"type":40,"tag":1809,"props":13939,"children":13940},{},[13941,13950,13955],{"type":40,"tag":1841,"props":13942,"children":13943},{},[13944],{"type":40,"tag":54,"props":13945,"children":13947},{"className":13946},[],[13948],{"type":45,"value":13949},"response.reasoning.done",{"type":40,"tag":1841,"props":13951,"children":13952},{},[13953],{"type":45,"value":13954},"Reasoning complete",{"type":40,"tag":1841,"props":13956,"children":13957},{},[13958],{"type":40,"tag":54,"props":13959,"children":13961},{"className":13960},[],[13962],{"type":45,"value":13963},"{ reasoning: string }",{"type":40,"tag":1809,"props":13965,"children":13966},{},[13967,13976,13981],{"type":40,"tag":1841,"props":13968,"children":13969},{},[13970],{"type":40,"tag":54,"props":13971,"children":13973},{"className":13972},[],[13974],{"type":45,"value":13975},"response.function_call_arguments.delta",{"type":40,"tag":1841,"props":13977,"children":13978},{},[13979],{"type":45,"value":13980},"Tool argument chunk",{"type":40,"tag":1841,"props":13982,"children":13983},{},[13984],{"type":40,"tag":54,"props":13985,"children":13987},{"className":13986},[],[13988],{"type":45,"value":13886},{"type":40,"tag":1809,"props":13990,"children":13991},{},[13992,14001,14006],{"type":40,"tag":1841,"props":13993,"children":13994},{},[13995],{"type":40,"tag":54,"props":13996,"children":13998},{"className":13997},[],[13999],{"type":45,"value":14000},"response.function_call_arguments.done",{"type":40,"tag":1841,"props":14002,"children":14003},{},[14004],{"type":45,"value":14005},"Tool arguments complete",{"type":40,"tag":1841,"props":14007,"children":14008},{},[14009],{"type":40,"tag":54,"props":14010,"children":14012},{"className":14011},[],[14013],{"type":45,"value":14014},"{ arguments: string }",{"type":40,"tag":1809,"props":14016,"children":14017},{},[14018,14027,14032],{"type":40,"tag":1841,"props":14019,"children":14020},{},[14021],{"type":40,"tag":54,"props":14022,"children":14024},{"className":14023},[],[14025],{"type":45,"value":14026},"response.completed",{"type":40,"tag":1841,"props":14028,"children":14029},{},[14030],{"type":45,"value":14031},"Full response complete",{"type":40,"tag":1841,"props":14033,"children":14034},{},[14035],{"type":40,"tag":54,"props":14036,"children":14038},{"className":14037},[],[14039],{"type":45,"value":13834},{"type":40,"tag":1809,"props":14041,"children":14042},{},[14043,14052,14057],{"type":40,"tag":1841,"props":14044,"children":14045},{},[14046],{"type":40,"tag":54,"props":14047,"children":14049},{"className":14048},[],[14050],{"type":45,"value":14051},"tool.preliminary_result",{"type":40,"tag":1841,"props":14053,"children":14054},{},[14055],{"type":45,"value":14056},"Generator tool progress",{"type":40,"tag":1841,"props":14058,"children":14059},{},[14060],{"type":40,"tag":54,"props":14061,"children":14063},{"className":14062},[],[14064],{"type":45,"value":14065},"{ toolCallId: string; result: unknown }",{"type":40,"tag":403,"props":14067,"children":14069},{"id":14068},"text-delta-event",[14070],{"type":45,"value":14071},"Text Delta Event",{"type":40,"tag":128,"props":14073,"children":14075},{"className":231,"code":14074,"language":19,"meta":133,"style":133},"interface OutputTextDeltaEvent {\n  type: 'response.output_text.delta';\n  delta: string;\n}\n",[14076],{"type":40,"tag":54,"props":14077,"children":14078},{"__ignoreMap":133},[14079,14095,14122,14142],{"type":40,"tag":139,"props":14080,"children":14081},{"class":141,"line":142},[14082,14086,14091],{"type":40,"tag":139,"props":14083,"children":14084},{"style":299},[14085],{"type":45,"value":11435},{"type":40,"tag":139,"props":14087,"children":14088},{"style":156},[14089],{"type":45,"value":14090}," OutputTextDeltaEvent",{"type":40,"tag":139,"props":14092,"children":14093},{"style":248},[14094],{"type":45,"value":1436},{"type":40,"tag":139,"props":14096,"children":14097},{"class":141,"line":152},[14098,14102,14106,14110,14114,14118],{"type":40,"tag":139,"props":14099,"children":14100},{"style":338},[14101],{"type":45,"value":12632},{"type":40,"tag":139,"props":14103,"children":14104},{"style":248},[14105],{"type":45,"value":346},{"type":40,"tag":139,"props":14107,"children":14108},{"style":248},[14109],{"type":45,"value":272},{"type":40,"tag":139,"props":14111,"children":14112},{"style":162},[14113],{"type":45,"value":13872},{"type":40,"tag":139,"props":14115,"children":14116},{"style":248},[14117],{"type":45,"value":281},{"type":40,"tag":139,"props":14119,"children":14120},{"style":248},[14121],{"type":45,"value":286},{"type":40,"tag":139,"props":14123,"children":14124},{"class":141,"line":173},[14125,14130,14134,14138],{"type":40,"tag":139,"props":14126,"children":14127},{"style":338},[14128],{"type":45,"value":14129},"  delta",{"type":40,"tag":139,"props":14131,"children":14132},{"style":248},[14133],{"type":45,"value":346},{"type":40,"tag":139,"props":14135,"children":14136},{"style":156},[14137],{"type":45,"value":11506},{"type":40,"tag":139,"props":14139,"children":14140},{"style":248},[14141],{"type":45,"value":286},{"type":40,"tag":139,"props":14143,"children":14144},{"class":141,"line":183},[14145],{"type":40,"tag":139,"props":14146,"children":14147},{"style":248},[14148],{"type":45,"value":5988},{"type":40,"tag":403,"props":14150,"children":14152},{"id":14151},"reasoning-delta-event",[14153],{"type":45,"value":14154},"Reasoning Delta Event",{"type":40,"tag":48,"props":14156,"children":14157},{},[14158],{"type":45,"value":14159},"For reasoning models (o1, etc.):",{"type":40,"tag":128,"props":14161,"children":14163},{"className":231,"code":14162,"language":19,"meta":133,"style":133},"interface ReasoningDeltaEvent {\n  type: 'response.reasoning.delta';\n  delta: string;\n}\n",[14164],{"type":40,"tag":54,"props":14165,"children":14166},{"__ignoreMap":133},[14167,14183,14210,14229],{"type":40,"tag":139,"props":14168,"children":14169},{"class":141,"line":142},[14170,14174,14179],{"type":40,"tag":139,"props":14171,"children":14172},{"style":299},[14173],{"type":45,"value":11435},{"type":40,"tag":139,"props":14175,"children":14176},{"style":156},[14177],{"type":45,"value":14178}," ReasoningDeltaEvent",{"type":40,"tag":139,"props":14180,"children":14181},{"style":248},[14182],{"type":45,"value":1436},{"type":40,"tag":139,"props":14184,"children":14185},{"class":141,"line":152},[14186,14190,14194,14198,14202,14206],{"type":40,"tag":139,"props":14187,"children":14188},{"style":338},[14189],{"type":45,"value":12632},{"type":40,"tag":139,"props":14191,"children":14192},{"style":248},[14193],{"type":45,"value":346},{"type":40,"tag":139,"props":14195,"children":14196},{"style":248},[14197],{"type":45,"value":272},{"type":40,"tag":139,"props":14199,"children":14200},{"style":162},[14201],{"type":45,"value":13924},{"type":40,"tag":139,"props":14203,"children":14204},{"style":248},[14205],{"type":45,"value":281},{"type":40,"tag":139,"props":14207,"children":14208},{"style":248},[14209],{"type":45,"value":286},{"type":40,"tag":139,"props":14211,"children":14212},{"class":141,"line":173},[14213,14217,14221,14225],{"type":40,"tag":139,"props":14214,"children":14215},{"style":338},[14216],{"type":45,"value":14129},{"type":40,"tag":139,"props":14218,"children":14219},{"style":248},[14220],{"type":45,"value":346},{"type":40,"tag":139,"props":14222,"children":14223},{"style":156},[14224],{"type":45,"value":11506},{"type":40,"tag":139,"props":14226,"children":14227},{"style":248},[14228],{"type":45,"value":286},{"type":40,"tag":139,"props":14230,"children":14231},{"class":141,"line":183},[14232],{"type":40,"tag":139,"props":14233,"children":14234},{"style":248},[14235],{"type":45,"value":5988},{"type":40,"tag":403,"props":14237,"children":14239},{"id":14238},"function-call-arguments-delta-event",[14240],{"type":45,"value":14241},"Function Call Arguments Delta Event",{"type":40,"tag":128,"props":14243,"children":14245},{"className":231,"code":14244,"language":19,"meta":133,"style":133},"interface FunctionCallArgumentsDeltaEvent {\n  type: 'response.function_call_arguments.delta';\n  delta: string;\n}\n",[14246],{"type":40,"tag":54,"props":14247,"children":14248},{"__ignoreMap":133},[14249,14265,14292,14311],{"type":40,"tag":139,"props":14250,"children":14251},{"class":141,"line":142},[14252,14256,14261],{"type":40,"tag":139,"props":14253,"children":14254},{"style":299},[14255],{"type":45,"value":11435},{"type":40,"tag":139,"props":14257,"children":14258},{"style":156},[14259],{"type":45,"value":14260}," FunctionCallArgumentsDeltaEvent",{"type":40,"tag":139,"props":14262,"children":14263},{"style":248},[14264],{"type":45,"value":1436},{"type":40,"tag":139,"props":14266,"children":14267},{"class":141,"line":152},[14268,14272,14276,14280,14284,14288],{"type":40,"tag":139,"props":14269,"children":14270},{"style":338},[14271],{"type":45,"value":12632},{"type":40,"tag":139,"props":14273,"children":14274},{"style":248},[14275],{"type":45,"value":346},{"type":40,"tag":139,"props":14277,"children":14278},{"style":248},[14279],{"type":45,"value":272},{"type":40,"tag":139,"props":14281,"children":14282},{"style":162},[14283],{"type":45,"value":13975},{"type":40,"tag":139,"props":14285,"children":14286},{"style":248},[14287],{"type":45,"value":281},{"type":40,"tag":139,"props":14289,"children":14290},{"style":248},[14291],{"type":45,"value":286},{"type":40,"tag":139,"props":14293,"children":14294},{"class":141,"line":173},[14295,14299,14303,14307],{"type":40,"tag":139,"props":14296,"children":14297},{"style":338},[14298],{"type":45,"value":14129},{"type":40,"tag":139,"props":14300,"children":14301},{"style":248},[14302],{"type":45,"value":346},{"type":40,"tag":139,"props":14304,"children":14305},{"style":156},[14306],{"type":45,"value":11506},{"type":40,"tag":139,"props":14308,"children":14309},{"style":248},[14310],{"type":45,"value":286},{"type":40,"tag":139,"props":14312,"children":14313},{"class":141,"line":183},[14314],{"type":40,"tag":139,"props":14315,"children":14316},{"style":248},[14317],{"type":45,"value":5988},{"type":40,"tag":403,"props":14319,"children":14321},{"id":14320},"tool-preliminary-result-event",[14322],{"type":45,"value":14323},"Tool Preliminary Result Event",{"type":40,"tag":48,"props":14325,"children":14326},{},[14327],{"type":45,"value":14328},"From generator tools that yield progress:",{"type":40,"tag":128,"props":14330,"children":14332},{"className":231,"code":14331,"language":19,"meta":133,"style":133},"interface ToolPreliminaryResultEvent {\n  type: 'tool.preliminary_result';\n  toolCallId: string;\n  result: unknown;  \u002F\u002F Matches the tool's eventSchema\n}\n",[14333],{"type":40,"tag":54,"props":14334,"children":14335},{"__ignoreMap":133},[14336,14351,14378,14397,14421],{"type":40,"tag":139,"props":14337,"children":14338},{"class":141,"line":142},[14339,14343,14347],{"type":40,"tag":139,"props":14340,"children":14341},{"style":299},[14342],{"type":45,"value":11435},{"type":40,"tag":139,"props":14344,"children":14345},{"style":156},[14346],{"type":45,"value":13772},{"type":40,"tag":139,"props":14348,"children":14349},{"style":248},[14350],{"type":45,"value":1436},{"type":40,"tag":139,"props":14352,"children":14353},{"class":141,"line":152},[14354,14358,14362,14366,14370,14374],{"type":40,"tag":139,"props":14355,"children":14356},{"style":338},[14357],{"type":45,"value":12632},{"type":40,"tag":139,"props":14359,"children":14360},{"style":248},[14361],{"type":45,"value":346},{"type":40,"tag":139,"props":14363,"children":14364},{"style":248},[14365],{"type":45,"value":272},{"type":40,"tag":139,"props":14367,"children":14368},{"style":162},[14369],{"type":45,"value":14051},{"type":40,"tag":139,"props":14371,"children":14372},{"style":248},[14373],{"type":45,"value":281},{"type":40,"tag":139,"props":14375,"children":14376},{"style":248},[14377],{"type":45,"value":286},{"type":40,"tag":139,"props":14379,"children":14380},{"class":141,"line":173},[14381,14385,14389,14393],{"type":40,"tag":139,"props":14382,"children":14383},{"style":338},[14384],{"type":45,"value":13000},{"type":40,"tag":139,"props":14386,"children":14387},{"style":248},[14388],{"type":45,"value":346},{"type":40,"tag":139,"props":14390,"children":14391},{"style":156},[14392],{"type":45,"value":11506},{"type":40,"tag":139,"props":14394,"children":14395},{"style":248},[14396],{"type":45,"value":286},{"type":40,"tag":139,"props":14398,"children":14399},{"class":141,"line":183},[14400,14404,14408,14412,14416],{"type":40,"tag":139,"props":14401,"children":14402},{"style":338},[14403],{"type":45,"value":13040},{"type":40,"tag":139,"props":14405,"children":14406},{"style":248},[14407],{"type":45,"value":346},{"type":40,"tag":139,"props":14409,"children":14410},{"style":156},[14411],{"type":45,"value":12571},{"type":40,"tag":139,"props":14413,"children":14414},{"style":248},[14415],{"type":45,"value":2056},{"type":40,"tag":139,"props":14417,"children":14418},{"style":146},[14419],{"type":45,"value":14420},"  \u002F\u002F Matches the tool's eventSchema\n",{"type":40,"tag":139,"props":14422,"children":14423},{"class":141,"line":192},[14424],{"type":40,"tag":139,"props":14425,"children":14426},{"style":248},[14427],{"type":45,"value":5988},{"type":40,"tag":403,"props":14429,"children":14431},{"id":14430},"response-completed-event",[14432],{"type":45,"value":14433},"Response Completed Event",{"type":40,"tag":128,"props":14435,"children":14437},{"className":231,"code":14436,"language":19,"meta":133,"style":133},"interface ResponseCompletedEvent {\n  type: 'response.completed';\n  response: OpenResponsesNonStreamingResponse;\n}\n",[14438],{"type":40,"tag":54,"props":14439,"children":14440},{"__ignoreMap":133},[14441,14457,14484,14503],{"type":40,"tag":139,"props":14442,"children":14443},{"class":141,"line":142},[14444,14448,14453],{"type":40,"tag":139,"props":14445,"children":14446},{"style":299},[14447],{"type":45,"value":11435},{"type":40,"tag":139,"props":14449,"children":14450},{"style":156},[14451],{"type":45,"value":14452}," ResponseCompletedEvent",{"type":40,"tag":139,"props":14454,"children":14455},{"style":248},[14456],{"type":45,"value":1436},{"type":40,"tag":139,"props":14458,"children":14459},{"class":141,"line":152},[14460,14464,14468,14472,14476,14480],{"type":40,"tag":139,"props":14461,"children":14462},{"style":338},[14463],{"type":45,"value":12632},{"type":40,"tag":139,"props":14465,"children":14466},{"style":248},[14467],{"type":45,"value":346},{"type":40,"tag":139,"props":14469,"children":14470},{"style":248},[14471],{"type":45,"value":272},{"type":40,"tag":139,"props":14473,"children":14474},{"style":162},[14475],{"type":45,"value":14026},{"type":40,"tag":139,"props":14477,"children":14478},{"style":248},[14479],{"type":45,"value":281},{"type":40,"tag":139,"props":14481,"children":14482},{"style":248},[14483],{"type":45,"value":286},{"type":40,"tag":139,"props":14485,"children":14486},{"class":141,"line":173},[14487,14491,14495,14499],{"type":40,"tag":139,"props":14488,"children":14489},{"style":338},[14490],{"type":45,"value":13271},{"type":40,"tag":139,"props":14492,"children":14493},{"style":248},[14494],{"type":45,"value":346},{"type":40,"tag":139,"props":14496,"children":14497},{"style":156},[14498],{"type":45,"value":12336},{"type":40,"tag":139,"props":14500,"children":14501},{"style":248},[14502],{"type":45,"value":286},{"type":40,"tag":139,"props":14504,"children":14505},{"class":141,"line":183},[14506],{"type":40,"tag":139,"props":14507,"children":14508},{"style":248},[14509],{"type":45,"value":5988},{"type":40,"tag":403,"props":14511,"children":14513},{"id":14512},"tool-stream-events",[14514],{"type":45,"value":14515},"Tool Stream Events",{"type":40,"tag":48,"props":14517,"children":14518},{},[14519,14520,14526],{"type":45,"value":4065},{"type":40,"tag":54,"props":14521,"children":14523},{"className":14522},[],[14524],{"type":45,"value":14525},"getToolStream()",{"type":45,"value":14527}," method yields:",{"type":40,"tag":128,"props":14529,"children":14531},{"className":231,"code":14530,"language":19,"meta":133,"style":133},"type ToolStreamEvent =\n  | { type: 'delta'; content: string }\n  | { type: 'preliminary_result'; toolCallId: string; result: unknown };\n",[14532],{"type":40,"tag":54,"props":14533,"children":14534},{"__ignoreMap":133},[14535,14551,14602],{"type":40,"tag":139,"props":14536,"children":14537},{"class":141,"line":142},[14538,14542,14547],{"type":40,"tag":139,"props":14539,"children":14540},{"style":299},[14541],{"type":45,"value":13641},{"type":40,"tag":139,"props":14543,"children":14544},{"style":156},[14545],{"type":45,"value":14546}," ToolStreamEvent",{"type":40,"tag":139,"props":14548,"children":14549},{"style":248},[14550],{"type":45,"value":13651},{"type":40,"tag":139,"props":14552,"children":14553},{"class":141,"line":152},[14554,14558,14562,14566,14570,14574,14578,14582,14586,14590,14594,14598],{"type":40,"tag":139,"props":14555,"children":14556},{"style":248},[14557],{"type":45,"value":13659},{"type":40,"tag":139,"props":14559,"children":14560},{"style":248},[14561],{"type":45,"value":251},{"type":40,"tag":139,"props":14563,"children":14564},{"style":338},[14565],{"type":45,"value":4881},{"type":40,"tag":139,"props":14567,"children":14568},{"style":248},[14569],{"type":45,"value":346},{"type":40,"tag":139,"props":14571,"children":14572},{"style":248},[14573],{"type":45,"value":272},{"type":40,"tag":139,"props":14575,"children":14576},{"style":162},[14577],{"type":45,"value":5972},{"type":40,"tag":139,"props":14579,"children":14580},{"style":248},[14581],{"type":45,"value":281},{"type":40,"tag":139,"props":14583,"children":14584},{"style":248},[14585],{"type":45,"value":2056},{"type":40,"tag":139,"props":14587,"children":14588},{"style":338},[14589],{"type":45,"value":4562},{"type":40,"tag":139,"props":14591,"children":14592},{"style":248},[14593],{"type":45,"value":346},{"type":40,"tag":139,"props":14595,"children":14596},{"style":156},[14597],{"type":45,"value":11506},{"type":40,"tag":139,"props":14599,"children":14600},{"style":248},[14601],{"type":45,"value":4698},{"type":40,"tag":139,"props":14603,"children":14604},{"class":141,"line":173},[14605,14609,14613,14617,14621,14625,14630,14634,14638,14643,14647,14651,14655,14659,14663,14667],{"type":40,"tag":139,"props":14606,"children":14607},{"style":248},[14608],{"type":45,"value":13659},{"type":40,"tag":139,"props":14610,"children":14611},{"style":248},[14612],{"type":45,"value":251},{"type":40,"tag":139,"props":14614,"children":14615},{"style":338},[14616],{"type":45,"value":4881},{"type":40,"tag":139,"props":14618,"children":14619},{"style":248},[14620],{"type":45,"value":346},{"type":40,"tag":139,"props":14622,"children":14623},{"style":248},[14624],{"type":45,"value":272},{"type":40,"tag":139,"props":14626,"children":14627},{"style":162},[14628],{"type":45,"value":14629},"preliminary_result",{"type":40,"tag":139,"props":14631,"children":14632},{"style":248},[14633],{"type":45,"value":281},{"type":40,"tag":139,"props":14635,"children":14636},{"style":248},[14637],{"type":45,"value":2056},{"type":40,"tag":139,"props":14639,"children":14640},{"style":338},[14641],{"type":45,"value":14642}," toolCallId",{"type":40,"tag":139,"props":14644,"children":14645},{"style":248},[14646],{"type":45,"value":346},{"type":40,"tag":139,"props":14648,"children":14649},{"style":156},[14650],{"type":45,"value":11506},{"type":40,"tag":139,"props":14652,"children":14653},{"style":248},[14654],{"type":45,"value":2056},{"type":40,"tag":139,"props":14656,"children":14657},{"style":338},[14658],{"type":45,"value":3762},{"type":40,"tag":139,"props":14660,"children":14661},{"style":248},[14662],{"type":45,"value":346},{"type":40,"tag":139,"props":14664,"children":14665},{"style":156},[14666],{"type":45,"value":12571},{"type":40,"tag":139,"props":14668,"children":14669},{"style":248},[14670],{"type":45,"value":2813},{"type":40,"tag":403,"props":14672,"children":14674},{"id":14673},"example-processing-stream-events",[14675],{"type":45,"value":14676},"Example: Processing Stream Events",{"type":40,"tag":128,"props":14678,"children":14680},{"className":231,"code":14679,"language":19,"meta":133,"style":133},"const result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Analyze this data',\n  tools: [analysisTool]\n});\n\nfor await (const event of result.getFullResponsesStream()) {\n  switch (event.type) {\n    case 'response.output_text.delta':\n      process.stdout.write(event.delta);\n      break;\n\n    case 'response.reasoning.delta':\n      console.log('[Reasoning]', event.delta);\n      break;\n\n    case 'response.function_call_arguments.delta':\n      console.log('[Tool Args]', event.delta);\n      break;\n\n    case 'tool.preliminary_result':\n      console.log(`[Progress: ${event.toolCallId}]`, event.result);\n      break;\n\n    case 'response.completed':\n      console.log('\\n[Complete]', event.response.usage);\n      break;\n  }\n}\n",[14681],{"type":40,"tag":54,"props":14682,"children":14683},{"__ignoreMap":133},[14684,14719,14746,14774,14790,14805,14812,14861,14894,14919,14967,14979,14986,15009,15067,15078,15085,15108,15164,15175,15182,15205,15287,15298,15305,15328,15398,15409,15416],{"type":40,"tag":139,"props":14685,"children":14686},{"class":141,"line":142},[14687,14691,14695,14699,14703,14707,14711,14715],{"type":40,"tag":139,"props":14688,"children":14689},{"style":299},[14690],{"type":45,"value":302},{"type":40,"tag":139,"props":14692,"children":14693},{"style":254},[14694],{"type":45,"value":646},{"type":40,"tag":139,"props":14696,"children":14697},{"style":248},[14698],{"type":45,"value":312},{"type":40,"tag":139,"props":14700,"children":14701},{"style":254},[14702],{"type":45,"value":655},{"type":40,"tag":139,"props":14704,"children":14705},{"style":248},[14706],{"type":45,"value":356},{"type":40,"tag":139,"props":14708,"children":14709},{"style":320},[14710],{"type":45,"value":59},{"type":40,"tag":139,"props":14712,"children":14713},{"style":254},[14714],{"type":45,"value":327},{"type":40,"tag":139,"props":14716,"children":14717},{"style":248},[14718],{"type":45,"value":332},{"type":40,"tag":139,"props":14720,"children":14721},{"class":141,"line":152},[14722,14726,14730,14734,14738,14742],{"type":40,"tag":139,"props":14723,"children":14724},{"style":338},[14725],{"type":45,"value":679},{"type":40,"tag":139,"props":14727,"children":14728},{"style":248},[14729],{"type":45,"value":346},{"type":40,"tag":139,"props":14731,"children":14732},{"style":248},[14733],{"type":45,"value":272},{"type":40,"tag":139,"props":14735,"children":14736},{"style":162},[14737],{"type":45,"value":692},{"type":40,"tag":139,"props":14739,"children":14740},{"style":248},[14741],{"type":45,"value":281},{"type":40,"tag":139,"props":14743,"children":14744},{"style":248},[14745],{"type":45,"value":701},{"type":40,"tag":139,"props":14747,"children":14748},{"class":141,"line":173},[14749,14753,14757,14761,14766,14770],{"type":40,"tag":139,"props":14750,"children":14751},{"style":338},[14752],{"type":45,"value":709},{"type":40,"tag":139,"props":14754,"children":14755},{"style":248},[14756],{"type":45,"value":346},{"type":40,"tag":139,"props":14758,"children":14759},{"style":248},[14760],{"type":45,"value":272},{"type":40,"tag":139,"props":14762,"children":14763},{"style":162},[14764],{"type":45,"value":14765},"Analyze this data",{"type":40,"tag":139,"props":14767,"children":14768},{"style":248},[14769],{"type":45,"value":281},{"type":40,"tag":139,"props":14771,"children":14772},{"style":248},[14773],{"type":45,"value":701},{"type":40,"tag":139,"props":14775,"children":14776},{"class":141,"line":183},[14777,14781,14785],{"type":40,"tag":139,"props":14778,"children":14779},{"style":338},[14780],{"type":45,"value":6812},{"type":40,"tag":139,"props":14782,"children":14783},{"style":248},[14784],{"type":45,"value":346},{"type":40,"tag":139,"props":14786,"children":14787},{"style":254},[14788],{"type":45,"value":14789}," [analysisTool]\n",{"type":40,"tag":139,"props":14791,"children":14792},{"class":141,"line":192},[14793,14797,14801],{"type":40,"tag":139,"props":14794,"children":14795},{"style":248},[14796],{"type":45,"value":378},{"type":40,"tag":139,"props":14798,"children":14799},{"style":254},[14800],{"type":45,"value":383},{"type":40,"tag":139,"props":14802,"children":14803},{"style":248},[14804],{"type":45,"value":286},{"type":40,"tag":139,"props":14806,"children":14807},{"class":141,"line":995},[14808],{"type":40,"tag":139,"props":14809,"children":14810},{"emptyLinePlaceholder":177},[14811],{"type":45,"value":180},{"type":40,"tag":139,"props":14813,"children":14814},{"class":141,"line":1213},[14815,14819,14823,14827,14831,14836,14840,14844,14848,14853,14857],{"type":40,"tag":139,"props":14816,"children":14817},{"style":242},[14818],{"type":45,"value":5893},{"type":40,"tag":139,"props":14820,"children":14821},{"style":242},[14822],{"type":45,"value":903},{"type":40,"tag":139,"props":14824,"children":14825},{"style":254},[14826],{"type":45,"value":2637},{"type":40,"tag":139,"props":14828,"children":14829},{"style":299},[14830],{"type":45,"value":302},{"type":40,"tag":139,"props":14832,"children":14833},{"style":254},[14834],{"type":45,"value":14835}," event ",{"type":40,"tag":139,"props":14837,"children":14838},{"style":248},[14839],{"type":45,"value":5915},{"type":40,"tag":139,"props":14841,"children":14842},{"style":254},[14843],{"type":45,"value":3762},{"type":40,"tag":139,"props":14845,"children":14846},{"style":248},[14847],{"type":45,"value":356},{"type":40,"tag":139,"props":14849,"children":14850},{"style":320},[14851],{"type":45,"value":14852},"getFullResponsesStream",{"type":40,"tag":139,"props":14854,"children":14855},{"style":254},[14856],{"type":45,"value":5933},{"type":40,"tag":139,"props":14858,"children":14859},{"style":248},[14860],{"type":45,"value":332},{"type":40,"tag":139,"props":14862,"children":14863},{"class":141,"line":1229},[14864,14869,14873,14878,14882,14886,14890],{"type":40,"tag":139,"props":14865,"children":14866},{"style":242},[14867],{"type":45,"value":14868},"  switch",{"type":40,"tag":139,"props":14870,"children":14871},{"style":338},[14872],{"type":45,"value":2637},{"type":40,"tag":139,"props":14874,"children":14875},{"style":254},[14876],{"type":45,"value":14877},"event",{"type":40,"tag":139,"props":14879,"children":14880},{"style":248},[14881],{"type":45,"value":356},{"type":40,"tag":139,"props":14883,"children":14884},{"style":254},[14885],{"type":45,"value":13641},{"type":40,"tag":139,"props":14887,"children":14888},{"style":338},[14889],{"type":45,"value":3042},{"type":40,"tag":139,"props":14891,"children":14892},{"style":248},[14893],{"type":45,"value":332},{"type":40,"tag":139,"props":14895,"children":14896},{"class":141,"line":1237},[14897,14902,14906,14910,14914],{"type":40,"tag":139,"props":14898,"children":14899},{"style":242},[14900],{"type":45,"value":14901},"    case",{"type":40,"tag":139,"props":14903,"children":14904},{"style":248},[14905],{"type":45,"value":272},{"type":40,"tag":139,"props":14907,"children":14908},{"style":162},[14909],{"type":45,"value":13872},{"type":40,"tag":139,"props":14911,"children":14912},{"style":248},[14913],{"type":45,"value":281},{"type":40,"tag":139,"props":14915,"children":14916},{"style":248},[14917],{"type":45,"value":14918},":\n",{"type":40,"tag":139,"props":14920,"children":14921},{"class":141,"line":1246},[14922,14927,14931,14935,14939,14943,14947,14951,14955,14959,14963],{"type":40,"tag":139,"props":14923,"children":14924},{"style":254},[14925],{"type":45,"value":14926},"      process",{"type":40,"tag":139,"props":14928,"children":14929},{"style":248},[14930],{"type":45,"value":356},{"type":40,"tag":139,"props":14932,"children":14933},{"style":254},[14934],{"type":45,"value":5954},{"type":40,"tag":139,"props":14936,"children":14937},{"style":248},[14938],{"type":45,"value":356},{"type":40,"tag":139,"props":14940,"children":14941},{"style":320},[14942],{"type":45,"value":5963},{"type":40,"tag":139,"props":14944,"children":14945},{"style":338},[14946],{"type":45,"value":327},{"type":40,"tag":139,"props":14948,"children":14949},{"style":254},[14950],{"type":45,"value":14877},{"type":40,"tag":139,"props":14952,"children":14953},{"style":248},[14954],{"type":45,"value":356},{"type":40,"tag":139,"props":14956,"children":14957},{"style":254},[14958],{"type":45,"value":5972},{"type":40,"tag":139,"props":14960,"children":14961},{"style":338},[14962],{"type":45,"value":383},{"type":40,"tag":139,"props":14964,"children":14965},{"style":248},[14966],{"type":45,"value":286},{"type":40,"tag":139,"props":14968,"children":14969},{"class":141,"line":1296},[14970,14975],{"type":40,"tag":139,"props":14971,"children":14972},{"style":242},[14973],{"type":45,"value":14974},"      break",{"type":40,"tag":139,"props":14976,"children":14977},{"style":248},[14978],{"type":45,"value":286},{"type":40,"tag":139,"props":14980,"children":14981},{"class":141,"line":1322},[14982],{"type":40,"tag":139,"props":14983,"children":14984},{"emptyLinePlaceholder":177},[14985],{"type":45,"value":180},{"type":40,"tag":139,"props":14987,"children":14988},{"class":141,"line":1338},[14989,14993,14997,15001,15005],{"type":40,"tag":139,"props":14990,"children":14991},{"style":242},[14992],{"type":45,"value":14901},{"type":40,"tag":139,"props":14994,"children":14995},{"style":248},[14996],{"type":45,"value":272},{"type":40,"tag":139,"props":14998,"children":14999},{"style":162},[15000],{"type":45,"value":13924},{"type":40,"tag":139,"props":15002,"children":15003},{"style":248},[15004],{"type":45,"value":281},{"type":40,"tag":139,"props":15006,"children":15007},{"style":248},[15008],{"type":45,"value":14918},{"type":40,"tag":139,"props":15010,"children":15011},{"class":141,"line":1346},[15012,15017,15021,15025,15029,15033,15038,15042,15046,15051,15055,15059,15063],{"type":40,"tag":139,"props":15013,"children":15014},{"style":254},[15015],{"type":45,"value":15016},"      console",{"type":40,"tag":139,"props":15018,"children":15019},{"style":248},[15020],{"type":45,"value":356},{"type":40,"tag":139,"props":15022,"children":15023},{"style":320},[15024],{"type":45,"value":952},{"type":40,"tag":139,"props":15026,"children":15027},{"style":338},[15028],{"type":45,"value":327},{"type":40,"tag":139,"props":15030,"children":15031},{"style":248},[15032],{"type":45,"value":281},{"type":40,"tag":139,"props":15034,"children":15035},{"style":162},[15036],{"type":45,"value":15037},"[Reasoning]",{"type":40,"tag":139,"props":15039,"children":15040},{"style":248},[15041],{"type":45,"value":281},{"type":40,"tag":139,"props":15043,"children":15044},{"style":248},[15045],{"type":45,"value":974},{"type":40,"tag":139,"props":15047,"children":15048},{"style":254},[15049],{"type":45,"value":15050}," event",{"type":40,"tag":139,"props":15052,"children":15053},{"style":248},[15054],{"type":45,"value":356},{"type":40,"tag":139,"props":15056,"children":15057},{"style":254},[15058],{"type":45,"value":5972},{"type":40,"tag":139,"props":15060,"children":15061},{"style":338},[15062],{"type":45,"value":383},{"type":40,"tag":139,"props":15064,"children":15065},{"style":248},[15066],{"type":45,"value":286},{"type":40,"tag":139,"props":15068,"children":15069},{"class":141,"line":1355},[15070,15074],{"type":40,"tag":139,"props":15071,"children":15072},{"style":242},[15073],{"type":45,"value":14974},{"type":40,"tag":139,"props":15075,"children":15076},{"style":248},[15077],{"type":45,"value":286},{"type":40,"tag":139,"props":15079,"children":15080},{"class":141,"line":1393},[15081],{"type":40,"tag":139,"props":15082,"children":15083},{"emptyLinePlaceholder":177},[15084],{"type":45,"value":180},{"type":40,"tag":139,"props":15086,"children":15087},{"class":141,"line":1421},[15088,15092,15096,15100,15104],{"type":40,"tag":139,"props":15089,"children":15090},{"style":242},[15091],{"type":45,"value":14901},{"type":40,"tag":139,"props":15093,"children":15094},{"style":248},[15095],{"type":45,"value":272},{"type":40,"tag":139,"props":15097,"children":15098},{"style":162},[15099],{"type":45,"value":13975},{"type":40,"tag":139,"props":15101,"children":15102},{"style":248},[15103],{"type":45,"value":281},{"type":40,"tag":139,"props":15105,"children":15106},{"style":248},[15107],{"type":45,"value":14918},{"type":40,"tag":139,"props":15109,"children":15110},{"class":141,"line":1439},[15111,15115,15119,15123,15127,15131,15136,15140,15144,15148,15152,15156,15160],{"type":40,"tag":139,"props":15112,"children":15113},{"style":254},[15114],{"type":45,"value":15016},{"type":40,"tag":139,"props":15116,"children":15117},{"style":248},[15118],{"type":45,"value":356},{"type":40,"tag":139,"props":15120,"children":15121},{"style":320},[15122],{"type":45,"value":952},{"type":40,"tag":139,"props":15124,"children":15125},{"style":338},[15126],{"type":45,"value":327},{"type":40,"tag":139,"props":15128,"children":15129},{"style":248},[15130],{"type":45,"value":281},{"type":40,"tag":139,"props":15132,"children":15133},{"style":162},[15134],{"type":45,"value":15135},"[Tool Args]",{"type":40,"tag":139,"props":15137,"children":15138},{"style":248},[15139],{"type":45,"value":281},{"type":40,"tag":139,"props":15141,"children":15142},{"style":248},[15143],{"type":45,"value":974},{"type":40,"tag":139,"props":15145,"children":15146},{"style":254},[15147],{"type":45,"value":15050},{"type":40,"tag":139,"props":15149,"children":15150},{"style":248},[15151],{"type":45,"value":356},{"type":40,"tag":139,"props":15153,"children":15154},{"style":254},[15155],{"type":45,"value":5972},{"type":40,"tag":139,"props":15157,"children":15158},{"style":338},[15159],{"type":45,"value":383},{"type":40,"tag":139,"props":15161,"children":15162},{"style":248},[15163],{"type":45,"value":286},{"type":40,"tag":139,"props":15165,"children":15166},{"class":141,"line":1465},[15167,15171],{"type":40,"tag":139,"props":15168,"children":15169},{"style":242},[15170],{"type":45,"value":14974},{"type":40,"tag":139,"props":15172,"children":15173},{"style":248},[15174],{"type":45,"value":286},{"type":40,"tag":139,"props":15176,"children":15177},{"class":141,"line":1474},[15178],{"type":40,"tag":139,"props":15179,"children":15180},{"emptyLinePlaceholder":177},[15181],{"type":45,"value":180},{"type":40,"tag":139,"props":15183,"children":15184},{"class":141,"line":1490},[15185,15189,15193,15197,15201],{"type":40,"tag":139,"props":15186,"children":15187},{"style":242},[15188],{"type":45,"value":14901},{"type":40,"tag":139,"props":15190,"children":15191},{"style":248},[15192],{"type":45,"value":272},{"type":40,"tag":139,"props":15194,"children":15195},{"style":162},[15196],{"type":45,"value":14051},{"type":40,"tag":139,"props":15198,"children":15199},{"style":248},[15200],{"type":45,"value":281},{"type":40,"tag":139,"props":15202,"children":15203},{"style":248},[15204],{"type":45,"value":14918},{"type":40,"tag":139,"props":15206,"children":15207},{"class":141,"line":1498},[15208,15212,15216,15220,15224,15228,15233,15237,15241,15245,15250,15254,15258,15262,15266,15270,15274,15279,15283],{"type":40,"tag":139,"props":15209,"children":15210},{"style":254},[15211],{"type":45,"value":15016},{"type":40,"tag":139,"props":15213,"children":15214},{"style":248},[15215],{"type":45,"value":356},{"type":40,"tag":139,"props":15217,"children":15218},{"style":320},[15219],{"type":45,"value":952},{"type":40,"tag":139,"props":15221,"children":15222},{"style":338},[15223],{"type":45,"value":327},{"type":40,"tag":139,"props":15225,"children":15226},{"style":248},[15227],{"type":45,"value":10554},{"type":40,"tag":139,"props":15229,"children":15230},{"style":162},[15231],{"type":45,"value":15232},"[Progress: ",{"type":40,"tag":139,"props":15234,"children":15235},{"style":248},[15236],{"type":45,"value":9403},{"type":40,"tag":139,"props":15238,"children":15239},{"style":254},[15240],{"type":45,"value":14877},{"type":40,"tag":139,"props":15242,"children":15243},{"style":248},[15244],{"type":45,"value":356},{"type":40,"tag":139,"props":15246,"children":15247},{"style":254},[15248],{"type":45,"value":15249},"toolCallId",{"type":40,"tag":139,"props":15251,"children":15252},{"style":248},[15253],{"type":45,"value":378},{"type":40,"tag":139,"props":15255,"children":15256},{"style":162},[15257],{"type":45,"value":10233},{"type":40,"tag":139,"props":15259,"children":15260},{"style":248},[15261],{"type":45,"value":10554},{"type":40,"tag":139,"props":15263,"children":15264},{"style":248},[15265],{"type":45,"value":974},{"type":40,"tag":139,"props":15267,"children":15268},{"style":254},[15269],{"type":45,"value":15050},{"type":40,"tag":139,"props":15271,"children":15272},{"style":248},[15273],{"type":45,"value":356},{"type":40,"tag":139,"props":15275,"children":15276},{"style":254},[15277],{"type":45,"value":15278},"result",{"type":40,"tag":139,"props":15280,"children":15281},{"style":338},[15282],{"type":45,"value":383},{"type":40,"tag":139,"props":15284,"children":15285},{"style":248},[15286],{"type":45,"value":286},{"type":40,"tag":139,"props":15288,"children":15289},{"class":141,"line":1507},[15290,15294],{"type":40,"tag":139,"props":15291,"children":15292},{"style":242},[15293],{"type":45,"value":14974},{"type":40,"tag":139,"props":15295,"children":15296},{"style":248},[15297],{"type":45,"value":286},{"type":40,"tag":139,"props":15299,"children":15300},{"class":141,"line":1544},[15301],{"type":40,"tag":139,"props":15302,"children":15303},{"emptyLinePlaceholder":177},[15304],{"type":45,"value":180},{"type":40,"tag":139,"props":15306,"children":15307},{"class":141,"line":1568},[15308,15312,15316,15320,15324],{"type":40,"tag":139,"props":15309,"children":15310},{"style":242},[15311],{"type":45,"value":14901},{"type":40,"tag":139,"props":15313,"children":15314},{"style":248},[15315],{"type":45,"value":272},{"type":40,"tag":139,"props":15317,"children":15318},{"style":162},[15319],{"type":45,"value":14026},{"type":40,"tag":139,"props":15321,"children":15322},{"style":248},[15323],{"type":45,"value":281},{"type":40,"tag":139,"props":15325,"children":15326},{"style":248},[15327],{"type":45,"value":14918},{"type":40,"tag":139,"props":15329,"children":15330},{"class":141,"line":27},[15331,15335,15339,15343,15347,15351,15356,15361,15365,15369,15373,15377,15382,15386,15390,15394],{"type":40,"tag":139,"props":15332,"children":15333},{"style":254},[15334],{"type":45,"value":15016},{"type":40,"tag":139,"props":15336,"children":15337},{"style":248},[15338],{"type":45,"value":356},{"type":40,"tag":139,"props":15340,"children":15341},{"style":320},[15342],{"type":45,"value":952},{"type":40,"tag":139,"props":15344,"children":15345},{"style":338},[15346],{"type":45,"value":327},{"type":40,"tag":139,"props":15348,"children":15349},{"style":248},[15350],{"type":45,"value":281},{"type":40,"tag":139,"props":15352,"children":15353},{"style":254},[15354],{"type":45,"value":15355},"\\n",{"type":40,"tag":139,"props":15357,"children":15358},{"style":162},[15359],{"type":45,"value":15360},"[Complete]",{"type":40,"tag":139,"props":15362,"children":15363},{"style":248},[15364],{"type":45,"value":281},{"type":40,"tag":139,"props":15366,"children":15367},{"style":248},[15368],{"type":45,"value":974},{"type":40,"tag":139,"props":15370,"children":15371},{"style":254},[15372],{"type":45,"value":15050},{"type":40,"tag":139,"props":15374,"children":15375},{"style":248},[15376],{"type":45,"value":356},{"type":40,"tag":139,"props":15378,"children":15379},{"style":254},[15380],{"type":45,"value":15381},"response",{"type":40,"tag":139,"props":15383,"children":15384},{"style":248},[15385],{"type":45,"value":356},{"type":40,"tag":139,"props":15387,"children":15388},{"style":254},[15389],{"type":45,"value":10326},{"type":40,"tag":139,"props":15391,"children":15392},{"style":338},[15393],{"type":45,"value":383},{"type":40,"tag":139,"props":15395,"children":15396},{"style":248},[15397],{"type":45,"value":286},{"type":40,"tag":139,"props":15399,"children":15400},{"class":141,"line":3010},[15401,15405],{"type":40,"tag":139,"props":15402,"children":15403},{"style":242},[15404],{"type":45,"value":14974},{"type":40,"tag":139,"props":15406,"children":15407},{"style":248},[15408],{"type":45,"value":286},{"type":40,"tag":139,"props":15410,"children":15411},{"class":141,"line":3018},[15412],{"type":40,"tag":139,"props":15413,"children":15414},{"style":248},[15415],{"type":45,"value":1471},{"type":40,"tag":139,"props":15417,"children":15418},{"class":141,"line":3049},[15419],{"type":40,"tag":139,"props":15420,"children":15421},{"style":248},[15422],{"type":45,"value":5988},{"type":40,"tag":403,"props":15424,"children":15426},{"id":15425},"message-stream-events",[15427],{"type":45,"value":15428},"Message Stream Events",{"type":40,"tag":48,"props":15430,"children":15431},{},[15432,15433,15439],{"type":45,"value":4065},{"type":40,"tag":54,"props":15434,"children":15436},{"className":15435},[],[15437],{"type":45,"value":15438},"getNewMessagesStream()",{"type":45,"value":15440}," yields OpenResponses format updates:",{"type":40,"tag":128,"props":15442,"children":15444},{"className":231,"code":15443,"language":19,"meta":133,"style":133},"type MessageStreamUpdate =\n  | ResponsesOutputMessage        \u002F\u002F Text\u002Fcontent updates\n  | OpenResponsesFunctionCallOutput;  \u002F\u002F Tool results\n",[15445],{"type":40,"tag":54,"props":15446,"children":15447},{"__ignoreMap":133},[15448,15464,15481],{"type":40,"tag":139,"props":15449,"children":15450},{"class":141,"line":142},[15451,15455,15460],{"type":40,"tag":139,"props":15452,"children":15453},{"style":299},[15454],{"type":45,"value":13641},{"type":40,"tag":139,"props":15456,"children":15457},{"style":156},[15458],{"type":45,"value":15459}," MessageStreamUpdate",{"type":40,"tag":139,"props":15461,"children":15462},{"style":248},[15463],{"type":45,"value":13651},{"type":40,"tag":139,"props":15465,"children":15466},{"class":141,"line":152},[15467,15471,15476],{"type":40,"tag":139,"props":15468,"children":15469},{"style":248},[15470],{"type":45,"value":13659},{"type":40,"tag":139,"props":15472,"children":15473},{"style":156},[15474],{"type":45,"value":15475}," ResponsesOutputMessage",{"type":40,"tag":139,"props":15477,"children":15478},{"style":146},[15479],{"type":45,"value":15480},"        \u002F\u002F Text\u002Fcontent updates\n",{"type":40,"tag":139,"props":15482,"children":15483},{"class":141,"line":173},[15484,15488,15493,15497],{"type":40,"tag":139,"props":15485,"children":15486},{"style":248},[15487],{"type":45,"value":13659},{"type":40,"tag":139,"props":15489,"children":15490},{"style":156},[15491],{"type":45,"value":15492}," OpenResponsesFunctionCallOutput",{"type":40,"tag":139,"props":15494,"children":15495},{"style":248},[15496],{"type":45,"value":2056},{"type":40,"tag":139,"props":15498,"children":15499},{"style":146},[15500],{"type":45,"value":15501},"  \u002F\u002F Tool results\n",{"type":40,"tag":403,"props":15503,"children":15505},{"id":15504},"example-tracking-new-messages",[15506],{"type":45,"value":15507},"Example: Tracking New Messages",{"type":40,"tag":128,"props":15509,"children":15511},{"className":231,"code":15510,"language":19,"meta":133,"style":133},"const result = client.callModel({\n  model: 'openai\u002Fgpt-5-nano',\n  input: 'Research this topic',\n  tools: [searchTool]\n});\n\nconst allMessages: MessageStreamUpdate[] = [];\n\nfor await (const message of result.getNewMessagesStream()) {\n  allMessages.push(message);\n\n  if (message.type === 'message') {\n    console.log('Assistant:', message.content);\n  } else if (message.type === 'function_call_output') {\n    console.log('Tool result:', message.output);\n  }\n}\n",[15512],{"type":40,"tag":54,"props":15513,"children":15514},{"__ignoreMap":133},[15515,15550,15577,15605,15620,15635,15642,15680,15687,15736,15769,15776,15824,15881,15938,15995,16002],{"type":40,"tag":139,"props":15516,"children":15517},{"class":141,"line":142},[15518,15522,15526,15530,15534,15538,15542,15546],{"type":40,"tag":139,"props":15519,"children":15520},{"style":299},[15521],{"type":45,"value":302},{"type":40,"tag":139,"props":15523,"children":15524},{"style":254},[15525],{"type":45,"value":646},{"type":40,"tag":139,"props":15527,"children":15528},{"style":248},[15529],{"type":45,"value":312},{"type":40,"tag":139,"props":15531,"children":15532},{"style":254},[15533],{"type":45,"value":655},{"type":40,"tag":139,"props":15535,"children":15536},{"style":248},[15537],{"type":45,"value":356},{"type":40,"tag":139,"props":15539,"children":15540},{"style":320},[15541],{"type":45,"value":59},{"type":40,"tag":139,"props":15543,"children":15544},{"style":254},[15545],{"type":45,"value":327},{"type":40,"tag":139,"props":15547,"children":15548},{"style":248},[15549],{"type":45,"value":332},{"type":40,"tag":139,"props":15551,"children":15552},{"class":141,"line":152},[15553,15557,15561,15565,15569,15573],{"type":40,"tag":139,"props":15554,"children":15555},{"style":338},[15556],{"type":45,"value":679},{"type":40,"tag":139,"props":15558,"children":15559},{"style":248},[15560],{"type":45,"value":346},{"type":40,"tag":139,"props":15562,"children":15563},{"style":248},[15564],{"type":45,"value":272},{"type":40,"tag":139,"props":15566,"children":15567},{"style":162},[15568],{"type":45,"value":692},{"type":40,"tag":139,"props":15570,"children":15571},{"style":248},[15572],{"type":45,"value":281},{"type":40,"tag":139,"props":15574,"children":15575},{"style":248},[15576],{"type":45,"value":701},{"type":40,"tag":139,"props":15578,"children":15579},{"class":141,"line":173},[15580,15584,15588,15592,15597,15601],{"type":40,"tag":139,"props":15581,"children":15582},{"style":338},[15583],{"type":45,"value":709},{"type":40,"tag":139,"props":15585,"children":15586},{"style":248},[15587],{"type":45,"value":346},{"type":40,"tag":139,"props":15589,"children":15590},{"style":248},[15591],{"type":45,"value":272},{"type":40,"tag":139,"props":15593,"children":15594},{"style":162},[15595],{"type":45,"value":15596},"Research this topic",{"type":40,"tag":139,"props":15598,"children":15599},{"style":248},[15600],{"type":45,"value":281},{"type":40,"tag":139,"props":15602,"children":15603},{"style":248},[15604],{"type":45,"value":701},{"type":40,"tag":139,"props":15606,"children":15607},{"class":141,"line":183},[15608,15612,15616],{"type":40,"tag":139,"props":15609,"children":15610},{"style":338},[15611],{"type":45,"value":6812},{"type":40,"tag":139,"props":15613,"children":15614},{"style":248},[15615],{"type":45,"value":346},{"type":40,"tag":139,"props":15617,"children":15618},{"style":254},[15619],{"type":45,"value":10458},{"type":40,"tag":139,"props":15621,"children":15622},{"class":141,"line":192},[15623,15627,15631],{"type":40,"tag":139,"props":15624,"children":15625},{"style":248},[15626],{"type":45,"value":378},{"type":40,"tag":139,"props":15628,"children":15629},{"style":254},[15630],{"type":45,"value":383},{"type":40,"tag":139,"props":15632,"children":15633},{"style":248},[15634],{"type":45,"value":286},{"type":40,"tag":139,"props":15636,"children":15637},{"class":141,"line":995},[15638],{"type":40,"tag":139,"props":15639,"children":15640},{"emptyLinePlaceholder":177},[15641],{"type":45,"value":180},{"type":40,"tag":139,"props":15643,"children":15644},{"class":141,"line":1213},[15645,15649,15654,15658,15662,15667,15671,15676],{"type":40,"tag":139,"props":15646,"children":15647},{"style":299},[15648],{"type":45,"value":302},{"type":40,"tag":139,"props":15650,"children":15651},{"style":254},[15652],{"type":45,"value":15653}," allMessages",{"type":40,"tag":139,"props":15655,"children":15656},{"style":248},[15657],{"type":45,"value":346},{"type":40,"tag":139,"props":15659,"children":15660},{"style":156},[15661],{"type":45,"value":15459},{"type":40,"tag":139,"props":15663,"children":15664},{"style":254},[15665],{"type":45,"value":15666},"[] ",{"type":40,"tag":139,"props":15668,"children":15669},{"style":248},[15670],{"type":45,"value":312},{"type":40,"tag":139,"props":15672,"children":15673},{"style":254},[15674],{"type":45,"value":15675}," []",{"type":40,"tag":139,"props":15677,"children":15678},{"style":248},[15679],{"type":45,"value":286},{"type":40,"tag":139,"props":15681,"children":15682},{"class":141,"line":1229},[15683],{"type":40,"tag":139,"props":15684,"children":15685},{"emptyLinePlaceholder":177},[15686],{"type":45,"value":180},{"type":40,"tag":139,"props":15688,"children":15689},{"class":141,"line":1237},[15690,15694,15698,15702,15706,15711,15715,15719,15723,15728,15732],{"type":40,"tag":139,"props":15691,"children":15692},{"style":242},[15693],{"type":45,"value":5893},{"type":40,"tag":139,"props":15695,"children":15696},{"style":242},[15697],{"type":45,"value":903},{"type":40,"tag":139,"props":15699,"children":15700},{"style":254},[15701],{"type":45,"value":2637},{"type":40,"tag":139,"props":15703,"children":15704},{"style":299},[15705],{"type":45,"value":302},{"type":40,"tag":139,"props":15707,"children":15708},{"style":254},[15709],{"type":45,"value":15710}," message ",{"type":40,"tag":139,"props":15712,"children":15713},{"style":248},[15714],{"type":45,"value":5915},{"type":40,"tag":139,"props":15716,"children":15717},{"style":254},[15718],{"type":45,"value":3762},{"type":40,"tag":139,"props":15720,"children":15721},{"style":248},[15722],{"type":45,"value":356},{"type":40,"tag":139,"props":15724,"children":15725},{"style":320},[15726],{"type":45,"value":15727},"getNewMessagesStream",{"type":40,"tag":139,"props":15729,"children":15730},{"style":254},[15731],{"type":45,"value":5933},{"type":40,"tag":139,"props":15733,"children":15734},{"style":248},[15735],{"type":45,"value":332},{"type":40,"tag":139,"props":15737,"children":15738},{"class":141,"line":1246},[15739,15744,15748,15753,15757,15761,15765],{"type":40,"tag":139,"props":15740,"children":15741},{"style":254},[15742],{"type":45,"value":15743},"  allMessages",{"type":40,"tag":139,"props":15745,"children":15746},{"style":248},[15747],{"type":45,"value":356},{"type":40,"tag":139,"props":15749,"children":15750},{"style":320},[15751],{"type":45,"value":15752},"push",{"type":40,"tag":139,"props":15754,"children":15755},{"style":338},[15756],{"type":45,"value":327},{"type":40,"tag":139,"props":15758,"children":15759},{"style":254},[15760],{"type":45,"value":12645},{"type":40,"tag":139,"props":15762,"children":15763},{"style":338},[15764],{"type":45,"value":383},{"type":40,"tag":139,"props":15766,"children":15767},{"style":248},[15768],{"type":45,"value":286},{"type":40,"tag":139,"props":15770,"children":15771},{"class":141,"line":1296},[15772],{"type":40,"tag":139,"props":15773,"children":15774},{"emptyLinePlaceholder":177},[15775],{"type":45,"value":180},{"type":40,"tag":139,"props":15777,"children":15778},{"class":141,"line":1322},[15779,15783,15787,15791,15795,15799,15804,15808,15812,15816,15820],{"type":40,"tag":139,"props":15780,"children":15781},{"style":242},[15782],{"type":45,"value":3024},{"type":40,"tag":139,"props":15784,"children":15785},{"style":338},[15786],{"type":45,"value":2637},{"type":40,"tag":139,"props":15788,"children":15789},{"style":254},[15790],{"type":45,"value":12645},{"type":40,"tag":139,"props":15792,"children":15793},{"style":248},[15794],{"type":45,"value":356},{"type":40,"tag":139,"props":15796,"children":15797},{"style":254},[15798],{"type":45,"value":13641},{"type":40,"tag":139,"props":15800,"children":15801},{"style":248},[15802],{"type":45,"value":15803}," ===",{"type":40,"tag":139,"props":15805,"children":15806},{"style":248},[15807],{"type":45,"value":272},{"type":40,"tag":139,"props":15809,"children":15810},{"style":162},[15811],{"type":45,"value":12645},{"type":40,"tag":139,"props":15813,"children":15814},{"style":248},[15815],{"type":45,"value":281},{"type":40,"tag":139,"props":15817,"children":15818},{"style":338},[15819],{"type":45,"value":3042},{"type":40,"tag":139,"props":15821,"children":15822},{"style":248},[15823],{"type":45,"value":332},{"type":40,"tag":139,"props":15825,"children":15826},{"class":141,"line":1338},[15827,15831,15835,15839,15843,15847,15852,15856,15860,15864,15868,15873,15877],{"type":40,"tag":139,"props":15828,"children":15829},{"style":254},[15830],{"type":45,"value":3405},{"type":40,"tag":139,"props":15832,"children":15833},{"style":248},[15834],{"type":45,"value":356},{"type":40,"tag":139,"props":15836,"children":15837},{"style":320},[15838],{"type":45,"value":952},{"type":40,"tag":139,"props":15840,"children":15841},{"style":338},[15842],{"type":45,"value":327},{"type":40,"tag":139,"props":15844,"children":15845},{"style":248},[15846],{"type":45,"value":281},{"type":40,"tag":139,"props":15848,"children":15849},{"style":162},[15850],{"type":45,"value":15851},"Assistant:",{"type":40,"tag":139,"props":15853,"children":15854},{"style":248},[15855],{"type":45,"value":281},{"type":40,"tag":139,"props":15857,"children":15858},{"style":248},[15859],{"type":45,"value":974},{"type":40,"tag":139,"props":15861,"children":15862},{"style":254},[15863],{"type":45,"value":7641},{"type":40,"tag":139,"props":15865,"children":15866},{"style":248},[15867],{"type":45,"value":356},{"type":40,"tag":139,"props":15869,"children":15870},{"style":254},[15871],{"type":45,"value":15872},"content",{"type":40,"tag":139,"props":15874,"children":15875},{"style":338},[15876],{"type":45,"value":383},{"type":40,"tag":139,"props":15878,"children":15879},{"style":248},[15880],{"type":45,"value":286},{"type":40,"tag":139,"props":15882,"children":15883},{"class":141,"line":1346},[15884,15888,15893,15898,15902,15906,15910,15914,15918,15922,15926,15930,15934],{"type":40,"tag":139,"props":15885,"children":15886},{"style":248},[15887],{"type":45,"value":2746},{"type":40,"tag":139,"props":15889,"children":15890},{"style":242},[15891],{"type":45,"value":15892}," else",{"type":40,"tag":139,"props":15894,"children":15895},{"style":242},[15896],{"type":45,"value":15897}," if",{"type":40,"tag":139,"props":15899,"children":15900},{"style":338},[15901],{"type":45,"value":2637},{"type":40,"tag":139,"props":15903,"children":15904},{"style":254},[15905],{"type":45,"value":12645},{"type":40,"tag":139,"props":15907,"children":15908},{"style":248},[15909],{"type":45,"value":356},{"type":40,"tag":139,"props":15911,"children":15912},{"style":254},[15913],{"type":45,"value":13641},{"type":40,"tag":139,"props":15915,"children":15916},{"style":248},[15917],{"type":45,"value":15803},{"type":40,"tag":139,"props":15919,"children":15920},{"style":248},[15921],{"type":45,"value":272},{"type":40,"tag":139,"props":15923,"children":15924},{"style":162},[15925],{"type":45,"value":12799},{"type":40,"tag":139,"props":15927,"children":15928},{"style":248},[15929],{"type":45,"value":281},{"type":40,"tag":139,"props":15931,"children":15932},{"style":338},[15933],{"type":45,"value":3042},{"type":40,"tag":139,"props":15935,"children":15936},{"style":248},[15937],{"type":45,"value":332},{"type":40,"tag":139,"props":15939,"children":15940},{"class":141,"line":1355},[15941,15945,15949,15953,15957,15961,15966,15970,15974,15978,15982,15987,15991],{"type":40,"tag":139,"props":15942,"children":15943},{"style":254},[15944],{"type":45,"value":3405},{"type":40,"tag":139,"props":15946,"children":15947},{"style":248},[15948],{"type":45,"value":356},{"type":40,"tag":139,"props":15950,"children":15951},{"style":320},[15952],{"type":45,"value":952},{"type":40,"tag":139,"props":15954,"children":15955},{"style":338},[15956],{"type":45,"value":327},{"type":40,"tag":139,"props":15958,"children":15959},{"style":248},[15960],{"type":45,"value":281},{"type":40,"tag":139,"props":15962,"children":15963},{"style":162},[15964],{"type":45,"value":15965},"Tool result:",{"type":40,"tag":139,"props":15967,"children":15968},{"style":248},[15969],{"type":45,"value":281},{"type":40,"tag":139,"props":15971,"children":15972},{"style":248},[15973],{"type":45,"value":974},{"type":40,"tag":139,"props":15975,"children":15976},{"style":254},[15977],{"type":45,"value":7641},{"type":40,"tag":139,"props":15979,"children":15980},{"style":248},[15981],{"type":45,"value":356},{"type":40,"tag":139,"props":15983,"children":15984},{"style":254},[15985],{"type":45,"value":15986},"output",{"type":40,"tag":139,"props":15988,"children":15989},{"style":338},[15990],{"type":45,"value":383},{"type":40,"tag":139,"props":15992,"children":15993},{"style":248},[15994],{"type":45,"value":286},{"type":40,"tag":139,"props":15996,"children":15997},{"class":141,"line":1393},[15998],{"type":40,"tag":139,"props":15999,"children":16000},{"style":248},[16001],{"type":45,"value":1471},{"type":40,"tag":139,"props":16003,"children":16004},{"class":141,"line":1421},[16005],{"type":40,"tag":139,"props":16006,"children":16007},{"style":248},[16008],{"type":45,"value":5988},{"type":40,"tag":117,"props":16010,"children":16011},{},[],{"type":40,"tag":121,"props":16013,"children":16015},{"id":16014},"api-reference",[16016],{"type":45,"value":16017},"API Reference",{"type":40,"tag":403,"props":16019,"children":16021},{"id":16020},"client-methods",[16022],{"type":45,"value":16023},"Client Methods",{"type":40,"tag":48,"props":16025,"children":16026},{},[16027,16029,16034,16036,16041],{"type":45,"value":16028},"Beyond ",{"type":40,"tag":54,"props":16030,"children":16032},{"className":16031},[],[16033],{"type":45,"value":59},{"type":45,"value":16035},", the SDK client (",{"type":40,"tag":54,"props":16037,"children":16039},{"className":16038},[],[16040],{"type":45,"value":113},{"type":45,"value":16042},") provides access to platform API endpoints:",{"type":40,"tag":128,"props":16044,"children":16046},{"className":231,"code":16045,"language":19,"meta":133,"style":133},"import OpenRouter from '@openrouter\u002Fsdk';\n\nconst sdkClient = new OpenRouter({\n  apiKey: process.env.OPENROUTER_API_KEY\n});\n\n\u002F\u002F List available models\nconst models = await sdkClient.models.list();\n\n\u002F\u002F Chat completions (alternative to callModel)\nconst completion = await sdkClient.chat.send({\n  model: 'openai\u002Fgpt-5-nano',\n  messages: [{ role: 'user', content: 'Hello!' }]\n});\n\n\u002F\u002F Legacy completions format\nconst legacyCompletion = await sdkClient.completions.generate({\n  model: 'openai\u002Fgpt-5-nano',\n  prompt: 'Once upon a time'\n});\n\n\u002F\u002F Usage analytics\nconst activity = await sdkClient.analytics.getUserActivity();\n\n\u002F\u002F Credit balance\nconst credits = await sdkClient.credits.getCredits();\n\n\u002F\u002F API key management\nconst keys = await sdkClient.apiKeys.list();\n",[16047],{"type":40,"tag":54,"props":16048,"children":16049},{"__ignoreMap":133},[16050,16081,16088,16119,16150,16165,16172,16180,16229,16236,16244,16293,16320,16393,16408,16415,16423,16473,16500,16525,16540,16547,16555,16605,16612,16620,16670,16677,16685],{"type":40,"tag":139,"props":16051,"children":16052},{"class":141,"line":142},[16053,16057,16061,16065,16069,16073,16077],{"type":40,"tag":139,"props":16054,"children":16055},{"style":242},[16056],{"type":45,"value":245},{"type":40,"tag":139,"props":16058,"children":16059},{"style":254},[16060],{"type":45,"value":779},{"type":40,"tag":139,"props":16062,"children":16063},{"style":242},[16064],{"type":45,"value":784},{"type":40,"tag":139,"props":16066,"children":16067},{"style":248},[16068],{"type":45,"value":272},{"type":40,"tag":139,"props":16070,"children":16071},{"style":162},[16072],{"type":45,"value":113},{"type":40,"tag":139,"props":16074,"children":16075},{"style":248},[16076],{"type":45,"value":281},{"type":40,"tag":139,"props":16078,"children":16079},{"style":248},[16080],{"type":45,"value":286},{"type":40,"tag":139,"props":16082,"children":16083},{"class":141,"line":152},[16084],{"type":40,"tag":139,"props":16085,"children":16086},{"emptyLinePlaceholder":177},[16087],{"type":45,"value":180},{"type":40,"tag":139,"props":16089,"children":16090},{"class":141,"line":173},[16091,16095,16099,16103,16107,16111,16115],{"type":40,"tag":139,"props":16092,"children":16093},{"style":299},[16094],{"type":45,"value":302},{"type":40,"tag":139,"props":16096,"children":16097},{"style":254},[16098],{"type":45,"value":812},{"type":40,"tag":139,"props":16100,"children":16101},{"style":248},[16102],{"type":45,"value":312},{"type":40,"tag":139,"props":16104,"children":16105},{"style":248},[16106],{"type":45,"value":317},{"type":40,"tag":139,"props":16108,"children":16109},{"style":320},[16110],{"type":45,"value":257},{"type":40,"tag":139,"props":16112,"children":16113},{"style":254},[16114],{"type":45,"value":327},{"type":40,"tag":139,"props":16116,"children":16117},{"style":248},[16118],{"type":45,"value":332},{"type":40,"tag":139,"props":16120,"children":16121},{"class":141,"line":183},[16122,16126,16130,16134,16138,16142,16146],{"type":40,"tag":139,"props":16123,"children":16124},{"style":338},[16125],{"type":45,"value":341},{"type":40,"tag":139,"props":16127,"children":16128},{"style":248},[16129],{"type":45,"value":346},{"type":40,"tag":139,"props":16131,"children":16132},{"style":254},[16133],{"type":45,"value":351},{"type":40,"tag":139,"props":16135,"children":16136},{"style":248},[16137],{"type":45,"value":356},{"type":40,"tag":139,"props":16139,"children":16140},{"style":254},[16141],{"type":45,"value":361},{"type":40,"tag":139,"props":16143,"children":16144},{"style":248},[16145],{"type":45,"value":356},{"type":40,"tag":139,"props":16147,"children":16148},{"style":254},[16149],{"type":45,"value":370},{"type":40,"tag":139,"props":16151,"children":16152},{"class":141,"line":192},[16153,16157,16161],{"type":40,"tag":139,"props":16154,"children":16155},{"style":248},[16156],{"type":45,"value":378},{"type":40,"tag":139,"props":16158,"children":16159},{"style":254},[16160],{"type":45,"value":383},{"type":40,"tag":139,"props":16162,"children":16163},{"style":248},[16164],{"type":45,"value":286},{"type":40,"tag":139,"props":16166,"children":16167},{"class":141,"line":995},[16168],{"type":40,"tag":139,"props":16169,"children":16170},{"emptyLinePlaceholder":177},[16171],{"type":45,"value":180},{"type":40,"tag":139,"props":16173,"children":16174},{"class":141,"line":1213},[16175],{"type":40,"tag":139,"props":16176,"children":16177},{"style":146},[16178],{"type":45,"value":16179},"\u002F\u002F List available models\n",{"type":40,"tag":139,"props":16181,"children":16182},{"class":141,"line":1229},[16183,16187,16192,16196,16200,16204,16208,16213,16217,16221,16225],{"type":40,"tag":139,"props":16184,"children":16185},{"style":299},[16186],{"type":45,"value":302},{"type":40,"tag":139,"props":16188,"children":16189},{"style":254},[16190],{"type":45,"value":16191}," models ",{"type":40,"tag":139,"props":16193,"children":16194},{"style":248},[16195],{"type":45,"value":312},{"type":40,"tag":139,"props":16197,"children":16198},{"style":242},[16199],{"type":45,"value":903},{"type":40,"tag":139,"props":16201,"children":16202},{"style":254},[16203],{"type":45,"value":908},{"type":40,"tag":139,"props":16205,"children":16206},{"style":248},[16207],{"type":45,"value":356},{"type":40,"tag":139,"props":16209,"children":16210},{"style":254},[16211],{"type":45,"value":16212},"models",{"type":40,"tag":139,"props":16214,"children":16215},{"style":248},[16216],{"type":45,"value":356},{"type":40,"tag":139,"props":16218,"children":16219},{"style":320},[16220],{"type":45,"value":1113},{"type":40,"tag":139,"props":16222,"children":16223},{"style":254},[16224],{"type":45,"value":931},{"type":40,"tag":139,"props":16226,"children":16227},{"style":248},[16228],{"type":45,"value":286},{"type":40,"tag":139,"props":16230,"children":16231},{"class":141,"line":1237},[16232],{"type":40,"tag":139,"props":16233,"children":16234},{"emptyLinePlaceholder":177},[16235],{"type":45,"value":180},{"type":40,"tag":139,"props":16237,"children":16238},{"class":141,"line":1246},[16239],{"type":40,"tag":139,"props":16240,"children":16241},{"style":146},[16242],{"type":45,"value":16243},"\u002F\u002F Chat completions (alternative to callModel)\n",{"type":40,"tag":139,"props":16245,"children":16246},{"class":141,"line":1296},[16247,16251,16256,16260,16264,16268,16272,16277,16281,16285,16289],{"type":40,"tag":139,"props":16248,"children":16249},{"style":299},[16250],{"type":45,"value":302},{"type":40,"tag":139,"props":16252,"children":16253},{"style":254},[16254],{"type":45,"value":16255}," completion ",{"type":40,"tag":139,"props":16257,"children":16258},{"style":248},[16259],{"type":45,"value":312},{"type":40,"tag":139,"props":16261,"children":16262},{"style":242},[16263],{"type":45,"value":903},{"type":40,"tag":139,"props":16265,"children":16266},{"style":254},[16267],{"type":45,"value":908},{"type":40,"tag":139,"props":16269,"children":16270},{"style":248},[16271],{"type":45,"value":356},{"type":40,"tag":139,"props":16273,"children":16274},{"style":254},[16275],{"type":45,"value":16276},"chat",{"type":40,"tag":139,"props":16278,"children":16279},{"style":248},[16280],{"type":45,"value":356},{"type":40,"tag":139,"props":16282,"children":16283},{"style":320},[16284],{"type":45,"value":3091},{"type":40,"tag":139,"props":16286,"children":16287},{"style":254},[16288],{"type":45,"value":327},{"type":40,"tag":139,"props":16290,"children":16291},{"style":248},[16292],{"type":45,"value":332},{"type":40,"tag":139,"props":16294,"children":16295},{"class":141,"line":1322},[16296,16300,16304,16308,16312,16316],{"type":40,"tag":139,"props":16297,"children":16298},{"style":338},[16299],{"type":45,"value":679},{"type":40,"tag":139,"props":16301,"children":16302},{"style":248},[16303],{"type":45,"value":346},{"type":40,"tag":139,"props":16305,"children":16306},{"style":248},[16307],{"type":45,"value":272},{"type":40,"tag":139,"props":16309,"children":16310},{"style":162},[16311],{"type":45,"value":692},{"type":40,"tag":139,"props":16313,"children":16314},{"style":248},[16315],{"type":45,"value":281},{"type":40,"tag":139,"props":16317,"children":16318},{"style":248},[16319],{"type":45,"value":701},{"type":40,"tag":139,"props":16321,"children":16322},{"class":141,"line":1338},[16323,16328,16332,16336,16340,16344,16348,16352,16356,16360,16364,16368,16372,16376,16380,16384,16388],{"type":40,"tag":139,"props":16324,"children":16325},{"style":338},[16326],{"type":45,"value":16327},"  messages",{"type":40,"tag":139,"props":16329,"children":16330},{"style":248},[16331],{"type":45,"value":346},{"type":40,"tag":139,"props":16333,"children":16334},{"style":254},[16335],{"type":45,"value":7746},{"type":40,"tag":139,"props":16337,"children":16338},{"style":248},[16339],{"type":45,"value":833},{"type":40,"tag":139,"props":16341,"children":16342},{"style":338},[16343],{"type":45,"value":4536},{"type":40,"tag":139,"props":16345,"children":16346},{"style":248},[16347],{"type":45,"value":346},{"type":40,"tag":139,"props":16349,"children":16350},{"style":248},[16351],{"type":45,"value":272},{"type":40,"tag":139,"props":16353,"children":16354},{"style":162},[16355],{"type":45,"value":4549},{"type":40,"tag":139,"props":16357,"children":16358},{"style":248},[16359],{"type":45,"value":281},{"type":40,"tag":139,"props":16361,"children":16362},{"style":248},[16363],{"type":45,"value":974},{"type":40,"tag":139,"props":16365,"children":16366},{"style":338},[16367],{"type":45,"value":4562},{"type":40,"tag":139,"props":16369,"children":16370},{"style":248},[16371],{"type":45,"value":346},{"type":40,"tag":139,"props":16373,"children":16374},{"style":248},[16375],{"type":45,"value":272},{"type":40,"tag":139,"props":16377,"children":16378},{"style":162},[16379],{"type":45,"value":722},{"type":40,"tag":139,"props":16381,"children":16382},{"style":248},[16383],{"type":45,"value":281},{"type":40,"tag":139,"props":16385,"children":16386},{"style":248},[16387],{"type":45,"value":262},{"type":40,"tag":139,"props":16389,"children":16390},{"style":254},[16391],{"type":45,"value":16392},"]\n",{"type":40,"tag":139,"props":16394,"children":16395},{"class":141,"line":1346},[16396,16400,16404],{"type":40,"tag":139,"props":16397,"children":16398},{"style":248},[16399],{"type":45,"value":378},{"type":40,"tag":139,"props":16401,"children":16402},{"style":254},[16403],{"type":45,"value":383},{"type":40,"tag":139,"props":16405,"children":16406},{"style":248},[16407],{"type":45,"value":286},{"type":40,"tag":139,"props":16409,"children":16410},{"class":141,"line":1355},[16411],{"type":40,"tag":139,"props":16412,"children":16413},{"emptyLinePlaceholder":177},[16414],{"type":45,"value":180},{"type":40,"tag":139,"props":16416,"children":16417},{"class":141,"line":1393},[16418],{"type":40,"tag":139,"props":16419,"children":16420},{"style":146},[16421],{"type":45,"value":16422},"\u002F\u002F Legacy completions format\n",{"type":40,"tag":139,"props":16424,"children":16425},{"class":141,"line":1421},[16426,16430,16435,16439,16443,16447,16451,16456,16460,16465,16469],{"type":40,"tag":139,"props":16427,"children":16428},{"style":299},[16429],{"type":45,"value":302},{"type":40,"tag":139,"props":16431,"children":16432},{"style":254},[16433],{"type":45,"value":16434}," legacyCompletion ",{"type":40,"tag":139,"props":16436,"children":16437},{"style":248},[16438],{"type":45,"value":312},{"type":40,"tag":139,"props":16440,"children":16441},{"style":242},[16442],{"type":45,"value":903},{"type":40,"tag":139,"props":16444,"children":16445},{"style":254},[16446],{"type":45,"value":908},{"type":40,"tag":139,"props":16448,"children":16449},{"style":248},[16450],{"type":45,"value":356},{"type":40,"tag":139,"props":16452,"children":16453},{"style":254},[16454],{"type":45,"value":16455},"completions",{"type":40,"tag":139,"props":16457,"children":16458},{"style":248},[16459],{"type":45,"value":356},{"type":40,"tag":139,"props":16461,"children":16462},{"style":320},[16463],{"type":45,"value":16464},"generate",{"type":40,"tag":139,"props":16466,"children":16467},{"style":254},[16468],{"type":45,"value":327},{"type":40,"tag":139,"props":16470,"children":16471},{"style":248},[16472],{"type":45,"value":332},{"type":40,"tag":139,"props":16474,"children":16475},{"class":141,"line":1439},[16476,16480,16484,16488,16492,16496],{"type":40,"tag":139,"props":16477,"children":16478},{"style":338},[16479],{"type":45,"value":679},{"type":40,"tag":139,"props":16481,"children":16482},{"style":248},[16483],{"type":45,"value":346},{"type":40,"tag":139,"props":16485,"children":16486},{"style":248},[16487],{"type":45,"value":272},{"type":40,"tag":139,"props":16489,"children":16490},{"style":162},[16491],{"type":45,"value":692},{"type":40,"tag":139,"props":16493,"children":16494},{"style":248},[16495],{"type":45,"value":281},{"type":40,"tag":139,"props":16497,"children":16498},{"style":248},[16499],{"type":45,"value":701},{"type":40,"tag":139,"props":16501,"children":16502},{"class":141,"line":1465},[16503,16508,16512,16516,16521],{"type":40,"tag":139,"props":16504,"children":16505},{"style":338},[16506],{"type":45,"value":16507},"  prompt",{"type":40,"tag":139,"props":16509,"children":16510},{"style":248},[16511],{"type":45,"value":346},{"type":40,"tag":139,"props":16513,"children":16514},{"style":248},[16515],{"type":45,"value":272},{"type":40,"tag":139,"props":16517,"children":16518},{"style":162},[16519],{"type":45,"value":16520},"Once upon a time",{"type":40,"tag":139,"props":16522,"children":16523},{"style":248},[16524],{"type":45,"value":727},{"type":40,"tag":139,"props":16526,"children":16527},{"class":141,"line":1474},[16528,16532,16536],{"type":40,"tag":139,"props":16529,"children":16530},{"style":248},[16531],{"type":45,"value":378},{"type":40,"tag":139,"props":16533,"children":16534},{"style":254},[16535],{"type":45,"value":383},{"type":40,"tag":139,"props":16537,"children":16538},{"style":248},[16539],{"type":45,"value":286},{"type":40,"tag":139,"props":16541,"children":16542},{"class":141,"line":1490},[16543],{"type":40,"tag":139,"props":16544,"children":16545},{"emptyLinePlaceholder":177},[16546],{"type":45,"value":180},{"type":40,"tag":139,"props":16548,"children":16549},{"class":141,"line":1498},[16550],{"type":40,"tag":139,"props":16551,"children":16552},{"style":146},[16553],{"type":45,"value":16554},"\u002F\u002F Usage analytics\n",{"type":40,"tag":139,"props":16556,"children":16557},{"class":141,"line":1507},[16558,16562,16567,16571,16575,16579,16583,16588,16592,16597,16601],{"type":40,"tag":139,"props":16559,"children":16560},{"style":299},[16561],{"type":45,"value":302},{"type":40,"tag":139,"props":16563,"children":16564},{"style":254},[16565],{"type":45,"value":16566}," activity ",{"type":40,"tag":139,"props":16568,"children":16569},{"style":248},[16570],{"type":45,"value":312},{"type":40,"tag":139,"props":16572,"children":16573},{"style":242},[16574],{"type":45,"value":903},{"type":40,"tag":139,"props":16576,"children":16577},{"style":254},[16578],{"type":45,"value":908},{"type":40,"tag":139,"props":16580,"children":16581},{"style":248},[16582],{"type":45,"value":356},{"type":40,"tag":139,"props":16584,"children":16585},{"style":254},[16586],{"type":45,"value":16587},"analytics",{"type":40,"tag":139,"props":16589,"children":16590},{"style":248},[16591],{"type":45,"value":356},{"type":40,"tag":139,"props":16593,"children":16594},{"style":320},[16595],{"type":45,"value":16596},"getUserActivity",{"type":40,"tag":139,"props":16598,"children":16599},{"style":254},[16600],{"type":45,"value":931},{"type":40,"tag":139,"props":16602,"children":16603},{"style":248},[16604],{"type":45,"value":286},{"type":40,"tag":139,"props":16606,"children":16607},{"class":141,"line":1544},[16608],{"type":40,"tag":139,"props":16609,"children":16610},{"emptyLinePlaceholder":177},[16611],{"type":45,"value":180},{"type":40,"tag":139,"props":16613,"children":16614},{"class":141,"line":1568},[16615],{"type":40,"tag":139,"props":16616,"children":16617},{"style":146},[16618],{"type":45,"value":16619},"\u002F\u002F Credit balance\n",{"type":40,"tag":139,"props":16621,"children":16622},{"class":141,"line":27},[16623,16627,16632,16636,16640,16644,16648,16653,16657,16662,16666],{"type":40,"tag":139,"props":16624,"children":16625},{"style":299},[16626],{"type":45,"value":302},{"type":40,"tag":139,"props":16628,"children":16629},{"style":254},[16630],{"type":45,"value":16631}," credits ",{"type":40,"tag":139,"props":16633,"children":16634},{"style":248},[16635],{"type":45,"value":312},{"type":40,"tag":139,"props":16637,"children":16638},{"style":242},[16639],{"type":45,"value":903},{"type":40,"tag":139,"props":16641,"children":16642},{"style":254},[16643],{"type":45,"value":908},{"type":40,"tag":139,"props":16645,"children":16646},{"style":248},[16647],{"type":45,"value":356},{"type":40,"tag":139,"props":16649,"children":16650},{"style":254},[16651],{"type":45,"value":16652},"credits",{"type":40,"tag":139,"props":16654,"children":16655},{"style":248},[16656],{"type":45,"value":356},{"type":40,"tag":139,"props":16658,"children":16659},{"style":320},[16660],{"type":45,"value":16661},"getCredits",{"type":40,"tag":139,"props":16663,"children":16664},{"style":254},[16665],{"type":45,"value":931},{"type":40,"tag":139,"props":16667,"children":16668},{"style":248},[16669],{"type":45,"value":286},{"type":40,"tag":139,"props":16671,"children":16672},{"class":141,"line":3010},[16673],{"type":40,"tag":139,"props":16674,"children":16675},{"emptyLinePlaceholder":177},[16676],{"type":45,"value":180},{"type":40,"tag":139,"props":16678,"children":16679},{"class":141,"line":3018},[16680],{"type":40,"tag":139,"props":16681,"children":16682},{"style":146},[16683],{"type":45,"value":16684},"\u002F\u002F API key management\n",{"type":40,"tag":139,"props":16686,"children":16687},{"class":141,"line":3049},[16688,16692,16696,16700,16704,16708,16712,16716,16720,16724,16728],{"type":40,"tag":139,"props":16689,"children":16690},{"style":299},[16691],{"type":45,"value":302},{"type":40,"tag":139,"props":16693,"children":16694},{"style":254},[16695],{"type":45,"value":1084},{"type":40,"tag":139,"props":16697,"children":16698},{"style":248},[16699],{"type":45,"value":312},{"type":40,"tag":139,"props":16701,"children":16702},{"style":242},[16703],{"type":45,"value":903},{"type":40,"tag":139,"props":16705,"children":16706},{"style":254},[16707],{"type":45,"value":908},{"type":40,"tag":139,"props":16709,"children":16710},{"style":248},[16711],{"type":45,"value":356},{"type":40,"tag":139,"props":16713,"children":16714},{"style":254},[16715],{"type":45,"value":917},{"type":40,"tag":139,"props":16717,"children":16718},{"style":248},[16719],{"type":45,"value":356},{"type":40,"tag":139,"props":16721,"children":16722},{"style":320},[16723],{"type":45,"value":1113},{"type":40,"tag":139,"props":16725,"children":16726},{"style":254},[16727],{"type":45,"value":931},{"type":40,"tag":139,"props":16729,"children":16730},{"style":248},[16731],{"type":45,"value":286},{"type":40,"tag":117,"props":16733,"children":16734},{},[],{"type":40,"tag":121,"props":16736,"children":16738},{"id":16737},"error-handling",[16739],{"type":45,"value":16740},"Error Handling",{"type":40,"tag":48,"props":16742,"children":16743},{},[16744],{"type":45,"value":16745},"The SDK provides specific error types with actionable messages:",{"type":40,"tag":128,"props":16747,"children":16749},{"className":231,"code":16748,"language":19,"meta":133,"style":133},"try {\n  const result = await client.callModel({\n    model: 'openai\u002Fgpt-5-nano',\n    input: 'Hello!'\n  });\n  const text = await result.getText();\n} catch (error) {\n  if (error.statusCode === 401) {\n    console.error('Invalid API key - check your OPENROUTER_API_KEY');\n  } else if (error.statusCode === 402) {\n    console.error('Insufficient credits - add credits at openrouter.ai');\n  } else if (error.statusCode === 429) {\n    console.error('Rate limited - implement backoff retry');\n  } else if (error.statusCode === 503) {\n    console.error('Model temporarily unavailable - try again or use fallback');\n  } else {\n    console.error('Unexpected error:', error.message);\n  }\n}\n",[16750],{"type":40,"tag":54,"props":16751,"children":16752},{"__ignoreMap":133},[16753,16765,16804,16831,16854,16869,16908,16928,16969,17009,17057,17097,17145,17185,17233,17273,17288,17344,17351],{"type":40,"tag":139,"props":16754,"children":16755},{"class":141,"line":142},[16756,16761],{"type":40,"tag":139,"props":16757,"children":16758},{"style":242},[16759],{"type":45,"value":16760},"try",{"type":40,"tag":139,"props":16762,"children":16763},{"style":248},[16764],{"type":45,"value":1436},{"type":40,"tag":139,"props":16766,"children":16767},{"class":141,"line":152},[16768,16772,16776,16780,16784,16788,16792,16796,16800],{"type":40,"tag":139,"props":16769,"children":16770},{"style":299},[16771],{"type":45,"value":2673},{"type":40,"tag":139,"props":16773,"children":16774},{"style":254},[16775],{"type":45,"value":3762},{"type":40,"tag":139,"props":16777,"children":16778},{"style":248},[16779],{"type":45,"value":2682},{"type":40,"tag":139,"props":16781,"children":16782},{"style":242},[16783],{"type":45,"value":903},{"type":40,"tag":139,"props":16785,"children":16786},{"style":254},[16787],{"type":45,"value":655},{"type":40,"tag":139,"props":16789,"children":16790},{"style":248},[16791],{"type":45,"value":356},{"type":40,"tag":139,"props":16793,"children":16794},{"style":320},[16795],{"type":45,"value":59},{"type":40,"tag":139,"props":16797,"children":16798},{"style":338},[16799],{"type":45,"value":327},{"type":40,"tag":139,"props":16801,"children":16802},{"style":248},[16803],{"type":45,"value":332},{"type":40,"tag":139,"props":16805,"children":16806},{"class":141,"line":173},[16807,16811,16815,16819,16823,16827],{"type":40,"tag":139,"props":16808,"children":16809},{"style":338},[16810],{"type":45,"value":3795},{"type":40,"tag":139,"props":16812,"children":16813},{"style":248},[16814],{"type":45,"value":346},{"type":40,"tag":139,"props":16816,"children":16817},{"style":248},[16818],{"type":45,"value":272},{"type":40,"tag":139,"props":16820,"children":16821},{"style":162},[16822],{"type":45,"value":692},{"type":40,"tag":139,"props":16824,"children":16825},{"style":248},[16826],{"type":45,"value":281},{"type":40,"tag":139,"props":16828,"children":16829},{"style":248},[16830],{"type":45,"value":701},{"type":40,"tag":139,"props":16832,"children":16833},{"class":141,"line":183},[16834,16838,16842,16846,16850],{"type":40,"tag":139,"props":16835,"children":16836},{"style":338},[16837],{"type":45,"value":3824},{"type":40,"tag":139,"props":16839,"children":16840},{"style":248},[16841],{"type":45,"value":346},{"type":40,"tag":139,"props":16843,"children":16844},{"style":248},[16845],{"type":45,"value":272},{"type":40,"tag":139,"props":16847,"children":16848},{"style":162},[16849],{"type":45,"value":722},{"type":40,"tag":139,"props":16851,"children":16852},{"style":248},[16853],{"type":45,"value":727},{"type":40,"tag":139,"props":16855,"children":16856},{"class":141,"line":192},[16857,16861,16865],{"type":40,"tag":139,"props":16858,"children":16859},{"style":248},[16860],{"type":45,"value":2746},{"type":40,"tag":139,"props":16862,"children":16863},{"style":338},[16864],{"type":45,"value":383},{"type":40,"tag":139,"props":16866,"children":16867},{"style":248},[16868],{"type":45,"value":286},{"type":40,"tag":139,"props":16870,"children":16871},{"class":141,"line":995},[16872,16876,16880,16884,16888,16892,16896,16900,16904],{"type":40,"tag":139,"props":16873,"children":16874},{"style":299},[16875],{"type":45,"value":2673},{"type":40,"tag":139,"props":16877,"children":16878},{"style":254},[16879],{"type":45,"value":3887},{"type":40,"tag":139,"props":16881,"children":16882},{"style":248},[16883],{"type":45,"value":2682},{"type":40,"tag":139,"props":16885,"children":16886},{"style":242},[16887],{"type":45,"value":903},{"type":40,"tag":139,"props":16889,"children":16890},{"style":254},[16891],{"type":45,"value":3762},{"type":40,"tag":139,"props":16893,"children":16894},{"style":248},[16895],{"type":45,"value":356},{"type":40,"tag":139,"props":16897,"children":16898},{"style":320},[16899],{"type":45,"value":3908},{"type":40,"tag":139,"props":16901,"children":16902},{"style":338},[16903],{"type":45,"value":931},{"type":40,"tag":139,"props":16905,"children":16906},{"style":248},[16907],{"type":45,"value":286},{"type":40,"tag":139,"props":16909,"children":16910},{"class":141,"line":1213},[16911,16915,16919,16924],{"type":40,"tag":139,"props":16912,"children":16913},{"style":248},[16914],{"type":45,"value":378},{"type":40,"tag":139,"props":16916,"children":16917},{"style":242},[16918],{"type":45,"value":3379},{"type":40,"tag":139,"props":16920,"children":16921},{"style":254},[16922],{"type":45,"value":16923}," (error) ",{"type":40,"tag":139,"props":16925,"children":16926},{"style":248},[16927],{"type":45,"value":332},{"type":40,"tag":139,"props":16929,"children":16930},{"class":141,"line":1229},[16931,16935,16939,16943,16947,16952,16956,16961,16965],{"type":40,"tag":139,"props":16932,"children":16933},{"style":242},[16934],{"type":45,"value":3024},{"type":40,"tag":139,"props":16936,"children":16937},{"style":338},[16938],{"type":45,"value":2637},{"type":40,"tag":139,"props":16940,"children":16941},{"style":254},[16942],{"type":45,"value":3388},{"type":40,"tag":139,"props":16944,"children":16945},{"style":248},[16946],{"type":45,"value":356},{"type":40,"tag":139,"props":16948,"children":16949},{"style":254},[16950],{"type":45,"value":16951},"statusCode",{"type":40,"tag":139,"props":16953,"children":16954},{"style":248},[16955],{"type":45,"value":15803},{"type":40,"tag":139,"props":16957,"children":16958},{"style":3075},[16959],{"type":45,"value":16960}," 401",{"type":40,"tag":139,"props":16962,"children":16963},{"style":338},[16964],{"type":45,"value":3042},{"type":40,"tag":139,"props":16966,"children":16967},{"style":248},[16968],{"type":45,"value":332},{"type":40,"tag":139,"props":16970,"children":16971},{"class":141,"line":1237},[16972,16976,16980,16984,16988,16992,16997,17001,17005],{"type":40,"tag":139,"props":16973,"children":16974},{"style":254},[16975],{"type":45,"value":3405},{"type":40,"tag":139,"props":16977,"children":16978},{"style":248},[16979],{"type":45,"value":356},{"type":40,"tag":139,"props":16981,"children":16982},{"style":320},[16983],{"type":45,"value":3388},{"type":40,"tag":139,"props":16985,"children":16986},{"style":338},[16987],{"type":45,"value":327},{"type":40,"tag":139,"props":16989,"children":16990},{"style":248},[16991],{"type":45,"value":281},{"type":40,"tag":139,"props":16993,"children":16994},{"style":162},[16995],{"type":45,"value":16996},"Invalid API key - check your OPENROUTER_API_KEY",{"type":40,"tag":139,"props":16998,"children":16999},{"style":248},[17000],{"type":45,"value":281},{"type":40,"tag":139,"props":17002,"children":17003},{"style":338},[17004],{"type":45,"value":383},{"type":40,"tag":139,"props":17006,"children":17007},{"style":248},[17008],{"type":45,"value":286},{"type":40,"tag":139,"props":17010,"children":17011},{"class":141,"line":1246},[17012,17016,17020,17024,17028,17032,17036,17040,17044,17049,17053],{"type":40,"tag":139,"props":17013,"children":17014},{"style":248},[17015],{"type":45,"value":2746},{"type":40,"tag":139,"props":17017,"children":17018},{"style":242},[17019],{"type":45,"value":15892},{"type":40,"tag":139,"props":17021,"children":17022},{"style":242},[17023],{"type":45,"value":15897},{"type":40,"tag":139,"props":17025,"children":17026},{"style":338},[17027],{"type":45,"value":2637},{"type":40,"tag":139,"props":17029,"children":17030},{"style":254},[17031],{"type":45,"value":3388},{"type":40,"tag":139,"props":17033,"children":17034},{"style":248},[17035],{"type":45,"value":356},{"type":40,"tag":139,"props":17037,"children":17038},{"style":254},[17039],{"type":45,"value":16951},{"type":40,"tag":139,"props":17041,"children":17042},{"style":248},[17043],{"type":45,"value":15803},{"type":40,"tag":139,"props":17045,"children":17046},{"style":3075},[17047],{"type":45,"value":17048}," 402",{"type":40,"tag":139,"props":17050,"children":17051},{"style":338},[17052],{"type":45,"value":3042},{"type":40,"tag":139,"props":17054,"children":17055},{"style":248},[17056],{"type":45,"value":332},{"type":40,"tag":139,"props":17058,"children":17059},{"class":141,"line":1296},[17060,17064,17068,17072,17076,17080,17085,17089,17093],{"type":40,"tag":139,"props":17061,"children":17062},{"style":254},[17063],{"type":45,"value":3405},{"type":40,"tag":139,"props":17065,"children":17066},{"style":248},[17067],{"type":45,"value":356},{"type":40,"tag":139,"props":17069,"children":17070},{"style":320},[17071],{"type":45,"value":3388},{"type":40,"tag":139,"props":17073,"children":17074},{"style":338},[17075],{"type":45,"value":327},{"type":40,"tag":139,"props":17077,"children":17078},{"style":248},[17079],{"type":45,"value":281},{"type":40,"tag":139,"props":17081,"children":17082},{"style":162},[17083],{"type":45,"value":17084},"Insufficient credits - add credits at openrouter.ai",{"type":40,"tag":139,"props":17086,"children":17087},{"style":248},[17088],{"type":45,"value":281},{"type":40,"tag":139,"props":17090,"children":17091},{"style":338},[17092],{"type":45,"value":383},{"type":40,"tag":139,"props":17094,"children":17095},{"style":248},[17096],{"type":45,"value":286},{"type":40,"tag":139,"props":17098,"children":17099},{"class":141,"line":1322},[17100,17104,17108,17112,17116,17120,17124,17128,17132,17137,17141],{"type":40,"tag":139,"props":17101,"children":17102},{"style":248},[17103],{"type":45,"value":2746},{"type":40,"tag":139,"props":17105,"children":17106},{"style":242},[17107],{"type":45,"value":15892},{"type":40,"tag":139,"props":17109,"children":17110},{"style":242},[17111],{"type":45,"value":15897},{"type":40,"tag":139,"props":17113,"children":17114},{"style":338},[17115],{"type":45,"value":2637},{"type":40,"tag":139,"props":17117,"children":17118},{"style":254},[17119],{"type":45,"value":3388},{"type":40,"tag":139,"props":17121,"children":17122},{"style":248},[17123],{"type":45,"value":356},{"type":40,"tag":139,"props":17125,"children":17126},{"style":254},[17127],{"type":45,"value":16951},{"type":40,"tag":139,"props":17129,"children":17130},{"style":248},[17131],{"type":45,"value":15803},{"type":40,"tag":139,"props":17133,"children":17134},{"style":3075},[17135],{"type":45,"value":17136}," 429",{"type":40,"tag":139,"props":17138,"children":17139},{"style":338},[17140],{"type":45,"value":3042},{"type":40,"tag":139,"props":17142,"children":17143},{"style":248},[17144],{"type":45,"value":332},{"type":40,"tag":139,"props":17146,"children":17147},{"class":141,"line":1338},[17148,17152,17156,17160,17164,17168,17173,17177,17181],{"type":40,"tag":139,"props":17149,"children":17150},{"style":254},[17151],{"type":45,"value":3405},{"type":40,"tag":139,"props":17153,"children":17154},{"style":248},[17155],{"type":45,"value":356},{"type":40,"tag":139,"props":17157,"children":17158},{"style":320},[17159],{"type":45,"value":3388},{"type":40,"tag":139,"props":17161,"children":17162},{"style":338},[17163],{"type":45,"value":327},{"type":40,"tag":139,"props":17165,"children":17166},{"style":248},[17167],{"type":45,"value":281},{"type":40,"tag":139,"props":17169,"children":17170},{"style":162},[17171],{"type":45,"value":17172},"Rate limited - implement backoff retry",{"type":40,"tag":139,"props":17174,"children":17175},{"style":248},[17176],{"type":45,"value":281},{"type":40,"tag":139,"props":17178,"children":17179},{"style":338},[17180],{"type":45,"value":383},{"type":40,"tag":139,"props":17182,"children":17183},{"style":248},[17184],{"type":45,"value":286},{"type":40,"tag":139,"props":17186,"children":17187},{"class":141,"line":1346},[17188,17192,17196,17200,17204,17208,17212,17216,17220,17225,17229],{"type":40,"tag":139,"props":17189,"children":17190},{"style":248},[17191],{"type":45,"value":2746},{"type":40,"tag":139,"props":17193,"children":17194},{"style":242},[17195],{"type":45,"value":15892},{"type":40,"tag":139,"props":17197,"children":17198},{"style":242},[17199],{"type":45,"value":15897},{"type":40,"tag":139,"props":17201,"children":17202},{"style":338},[17203],{"type":45,"value":2637},{"type":40,"tag":139,"props":17205,"children":17206},{"style":254},[17207],{"type":45,"value":3388},{"type":40,"tag":139,"props":17209,"children":17210},{"style":248},[17211],{"type":45,"value":356},{"type":40,"tag":139,"props":17213,"children":17214},{"style":254},[17215],{"type":45,"value":16951},{"type":40,"tag":139,"props":17217,"children":17218},{"style":248},[17219],{"type":45,"value":15803},{"type":40,"tag":139,"props":17221,"children":17222},{"style":3075},[17223],{"type":45,"value":17224}," 503",{"type":40,"tag":139,"props":17226,"children":17227},{"style":338},[17228],{"type":45,"value":3042},{"type":40,"tag":139,"props":17230,"children":17231},{"style":248},[17232],{"type":45,"value":332},{"type":40,"tag":139,"props":17234,"children":17235},{"class":141,"line":1355},[17236,17240,17244,17248,17252,17256,17261,17265,17269],{"type":40,"tag":139,"props":17237,"children":17238},{"style":254},[17239],{"type":45,"value":3405},{"type":40,"tag":139,"props":17241,"children":17242},{"style":248},[17243],{"type":45,"value":356},{"type":40,"tag":139,"props":17245,"children":17246},{"style":320},[17247],{"type":45,"value":3388},{"type":40,"tag":139,"props":17249,"children":17250},{"style":338},[17251],{"type":45,"value":327},{"type":40,"tag":139,"props":17253,"children":17254},{"style":248},[17255],{"type":45,"value":281},{"type":40,"tag":139,"props":17257,"children":17258},{"style":162},[17259],{"type":45,"value":17260},"Model temporarily unavailable - try again or use fallback",{"type":40,"tag":139,"props":17262,"children":17263},{"style":248},[17264],{"type":45,"value":281},{"type":40,"tag":139,"props":17266,"children":17267},{"style":338},[17268],{"type":45,"value":383},{"type":40,"tag":139,"props":17270,"children":17271},{"style":248},[17272],{"type":45,"value":286},{"type":40,"tag":139,"props":17274,"children":17275},{"class":141,"line":1393},[17276,17280,17284],{"type":40,"tag":139,"props":17277,"children":17278},{"style":248},[17279],{"type":45,"value":2746},{"type":40,"tag":139,"props":17281,"children":17282},{"style":242},[17283],{"type":45,"value":15892},{"type":40,"tag":139,"props":17285,"children":17286},{"style":248},[17287],{"type":45,"value":1436},{"type":40,"tag":139,"props":17289,"children":17290},{"class":141,"line":1421},[17291,17295,17299,17303,17307,17311,17316,17320,17324,17328,17332,17336,17340],{"type":40,"tag":139,"props":17292,"children":17293},{"style":254},[17294],{"type":45,"value":3405},{"type":40,"tag":139,"props":17296,"children":17297},{"style":248},[17298],{"type":45,"value":356},{"type":40,"tag":139,"props":17300,"children":17301},{"style":320},[17302],{"type":45,"value":3388},{"type":40,"tag":139,"props":17304,"children":17305},{"style":338},[17306],{"type":45,"value":327},{"type":40,"tag":139,"props":17308,"children":17309},{"style":248},[17310],{"type":45,"value":281},{"type":40,"tag":139,"props":17312,"children":17313},{"style":162},[17314],{"type":45,"value":17315},"Unexpected error:",{"type":40,"tag":139,"props":17317,"children":17318},{"style":248},[17319],{"type":45,"value":281},{"type":40,"tag":139,"props":17321,"children":17322},{"style":248},[17323],{"type":45,"value":974},{"type":40,"tag":139,"props":17325,"children":17326},{"style":254},[17327],{"type":45,"value":3439},{"type":40,"tag":139,"props":17329,"children":17330},{"style":248},[17331],{"type":45,"value":356},{"type":40,"tag":139,"props":17333,"children":17334},{"style":254},[17335],{"type":45,"value":12645},{"type":40,"tag":139,"props":17337,"children":17338},{"style":338},[17339],{"type":45,"value":383},{"type":40,"tag":139,"props":17341,"children":17342},{"style":248},[17343],{"type":45,"value":286},{"type":40,"tag":139,"props":17345,"children":17346},{"class":141,"line":1439},[17347],{"type":40,"tag":139,"props":17348,"children":17349},{"style":248},[17350],{"type":45,"value":1471},{"type":40,"tag":139,"props":17352,"children":17353},{"class":141,"line":1465},[17354],{"type":40,"tag":139,"props":17355,"children":17356},{"style":248},[17357],{"type":45,"value":5988},{"type":40,"tag":403,"props":17359,"children":17361},{"id":17360},"error-status-codes",[17362],{"type":45,"value":17363},"Error Status Codes",{"type":40,"tag":1801,"props":17365,"children":17366},{},[17367,17388],{"type":40,"tag":1805,"props":17368,"children":17369},{},[17370],{"type":40,"tag":1809,"props":17371,"children":17372},{},[17373,17378,17383],{"type":40,"tag":1813,"props":17374,"children":17375},{},[17376],{"type":45,"value":17377},"Code",{"type":40,"tag":1813,"props":17379,"children":17380},{},[17381],{"type":45,"value":17382},"Meaning",{"type":40,"tag":1813,"props":17384,"children":17385},{},[17386],{"type":45,"value":17387},"Action",{"type":40,"tag":1834,"props":17389,"children":17390},{},[17391,17408,17426,17444,17462,17480],{"type":40,"tag":1809,"props":17392,"children":17393},{},[17394,17398,17403],{"type":40,"tag":1841,"props":17395,"children":17396},{},[17397],{"type":45,"value":3078},{"type":40,"tag":1841,"props":17399,"children":17400},{},[17401],{"type":45,"value":17402},"Bad request",{"type":40,"tag":1841,"props":17404,"children":17405},{},[17406],{"type":45,"value":17407},"Check request parameters",{"type":40,"tag":1809,"props":17409,"children":17410},{},[17411,17416,17421],{"type":40,"tag":1841,"props":17412,"children":17413},{},[17414],{"type":45,"value":17415},"401",{"type":40,"tag":1841,"props":17417,"children":17418},{},[17419],{"type":45,"value":17420},"Unauthorized",{"type":40,"tag":1841,"props":17422,"children":17423},{},[17424],{"type":45,"value":17425},"Verify API key",{"type":40,"tag":1809,"props":17427,"children":17428},{},[17429,17434,17439],{"type":40,"tag":1841,"props":17430,"children":17431},{},[17432],{"type":45,"value":17433},"402",{"type":40,"tag":1841,"props":17435,"children":17436},{},[17437],{"type":45,"value":17438},"Payment required",{"type":40,"tag":1841,"props":17440,"children":17441},{},[17442],{"type":45,"value":17443},"Add credits",{"type":40,"tag":1809,"props":17445,"children":17446},{},[17447,17452,17457],{"type":40,"tag":1841,"props":17448,"children":17449},{},[17450],{"type":45,"value":17451},"429",{"type":40,"tag":1841,"props":17453,"children":17454},{},[17455],{"type":45,"value":17456},"Rate limited",{"type":40,"tag":1841,"props":17458,"children":17459},{},[17460],{"type":45,"value":17461},"Implement exponential backoff",{"type":40,"tag":1809,"props":17463,"children":17464},{},[17465,17470,17475],{"type":40,"tag":1841,"props":17466,"children":17467},{},[17468],{"type":45,"value":17469},"500",{"type":40,"tag":1841,"props":17471,"children":17472},{},[17473],{"type":45,"value":17474},"Server error",{"type":40,"tag":1841,"props":17476,"children":17477},{},[17478],{"type":45,"value":17479},"Retry with backoff",{"type":40,"tag":1809,"props":17481,"children":17482},{},[17483,17488,17493],{"type":40,"tag":1841,"props":17484,"children":17485},{},[17486],{"type":45,"value":17487},"503",{"type":40,"tag":1841,"props":17489,"children":17490},{},[17491],{"type":45,"value":17492},"Service unavailable",{"type":40,"tag":1841,"props":17494,"children":17495},{},[17496],{"type":45,"value":17497},"Try alternative model",{"type":40,"tag":117,"props":17499,"children":17500},{},[],{"type":40,"tag":121,"props":17502,"children":17504},{"id":17503},"complete-example-agent-with-tools",[17505],{"type":45,"value":17506},"Complete Example: Agent with Tools",{"type":40,"tag":128,"props":17508,"children":17510},{"className":231,"code":17509,"language":19,"meta":133,"style":133},"import { OpenRouter } from '@openrouter\u002Fagent';\nimport { tool } from '@openrouter\u002Fagent\u002Ftool';\nimport { stepCountIs, hasToolCall } from '@openrouter\u002Fagent\u002Fstop-conditions';\nimport { z } from 'zod';\n\nconst client = new OpenRouter({\n  apiKey: process.env.OPENROUTER_API_KEY\n});\n\n\u002F\u002F Define tools\nconst searchTool = tool({\n  name: 'web_search',\n  description: 'Search the web for information',\n  inputSchema: z.object({\n    query: z.string().describe('Search query')\n  }),\n  outputSchema: z.object({\n    results: z.array(z.object({\n      title: z.string(),\n      snippet: z.string(),\n      url: z.string()\n    }))\n  }),\n  execute: async ({ query }) => {\n    \u002F\u002F Implement actual search\n    return {\n      results: [\n        { title: 'Example', snippet: 'Example result', url: 'https:\u002F\u002Fexample.com' }\n      ]\n    };\n  }\n});\n\nconst finishTool = tool({\n  name: 'finish',\n  description: 'Complete the task with final answer',\n  inputSchema: z.object({\n    answer: z.string().describe('The final answer')\n  }),\n  execute: async ({ answer }) => ({ answer })\n});\n\n\u002F\u002F Run agent\nasync function runAgent(task: string) {\n  const result = client.callModel({\n    model: 'openai\u002Fgpt-5-nano',\n    instructions: 'You are a helpful research assistant. Use web_search to find information, then use finish to provide your final answer.',\n    input: task,\n    tools: [searchTool, finishTool],\n    stopWhen: [\n      stepCountIs(10),\n      hasToolCall('finish')\n    ]\n  });\n\n  \u002F\u002F Stream progress\n  for await (const toolCall of result.getToolCallsStream()) {\n    console.log(`[${toolCall.name}] ${JSON.stringify(toolCall.arguments)}`);\n  }\n\n  return await result.getText();\n}\n\n\u002F\u002F Usage\nconst answer = await runAgent('What are the latest developments in quantum computing?');\nconsole.log('Final answer:', answer);\n",[17511],{"type":40,"tag":54,"props":17512,"children":17513},{"__ignoreMap":133},[17514,17553,17592,17639,17678,17685,17716,17747,17762,17769,17777,17804,17831,17859,17890,17947,17962,17993,18037,18069,18101,18129,18141,18156,18191,18199,18210,18226,18310,18317,18324,18331,18346,18353,18381,18408,18436,18467,18524,18539,18592,18607,18614,18622,18663,18698,18725,18753,18773,18811,18827,18851,18879,18887,18902,18909,18917,18965,19057,19064,19071,19102,19109,19116,19125,19174],{"type":40,"tag":139,"props":17515,"children":17516},{"class":141,"line":142},[17517,17521,17525,17529,17533,17537,17541,17545,17549],{"type":40,"tag":139,"props":17518,"children":17519},{"style":242},[17520],{"type":45,"value":245},{"type":40,"tag":139,"props":17522,"children":17523},{"style":248},[17524],{"type":45,"value":251},{"type":40,"tag":139,"props":17526,"children":17527},{"style":254},[17528],{"type":45,"value":257},{"type":40,"tag":139,"props":17530,"children":17531},{"style":248},[17532],{"type":45,"value":262},{"type":40,"tag":139,"props":17534,"children":17535},{"style":242},[17536],{"type":45,"value":267},{"type":40,"tag":139,"props":17538,"children":17539},{"style":248},[17540],{"type":45,"value":272},{"type":40,"tag":139,"props":17542,"children":17543},{"style":162},[17544],{"type":45,"value":84},{"type":40,"tag":139,"props":17546,"children":17547},{"style":248},[17548],{"type":45,"value":281},{"type":40,"tag":139,"props":17550,"children":17551},{"style":248},[17552],{"type":45,"value":286},{"type":40,"tag":139,"props":17554,"children":17555},{"class":141,"line":152},[17556,17560,17564,17568,17572,17576,17580,17584,17588],{"type":40,"tag":139,"props":17557,"children":17558},{"style":242},[17559],{"type":45,"value":245},{"type":40,"tag":139,"props":17561,"children":17562},{"style":248},[17563],{"type":45,"value":251},{"type":40,"tag":139,"props":17565,"children":17566},{"style":254},[17567],{"type":45,"value":6031},{"type":40,"tag":139,"props":17569,"children":17570},{"style":248},[17571],{"type":45,"value":262},{"type":40,"tag":139,"props":17573,"children":17574},{"style":242},[17575],{"type":45,"value":267},{"type":40,"tag":139,"props":17577,"children":17578},{"style":248},[17579],{"type":45,"value":272},{"type":40,"tag":139,"props":17581,"children":17582},{"style":162},[17583],{"type":45,"value":6048},{"type":40,"tag":139,"props":17585,"children":17586},{"style":248},[17587],{"type":45,"value":281},{"type":40,"tag":139,"props":17589,"children":17590},{"style":248},[17591],{"type":45,"value":286},{"type":40,"tag":139,"props":17593,"children":17594},{"class":141,"line":173},[17595,17599,17603,17607,17611,17615,17619,17623,17627,17631,17635],{"type":40,"tag":139,"props":17596,"children":17597},{"style":242},[17598],{"type":45,"value":245},{"type":40,"tag":139,"props":17600,"children":17601},{"style":248},[17602],{"type":45,"value":251},{"type":40,"tag":139,"props":17604,"children":17605},{"style":254},[17606],{"type":45,"value":8053},{"type":40,"tag":139,"props":17608,"children":17609},{"style":248},[17610],{"type":45,"value":974},{"type":40,"tag":139,"props":17612,"children":17613},{"style":254},[17614],{"type":45,"value":8071},{"type":40,"tag":139,"props":17616,"children":17617},{"style":248},[17618],{"type":45,"value":262},{"type":40,"tag":139,"props":17620,"children":17621},{"style":242},[17622],{"type":45,"value":267},{"type":40,"tag":139,"props":17624,"children":17625},{"style":248},[17626],{"type":45,"value":272},{"type":40,"tag":139,"props":17628,"children":17629},{"style":162},[17630],{"type":45,"value":8088},{"type":40,"tag":139,"props":17632,"children":17633},{"style":248},[17634],{"type":45,"value":281},{"type":40,"tag":139,"props":17636,"children":17637},{"style":248},[17638],{"type":45,"value":286},{"type":40,"tag":139,"props":17640,"children":17641},{"class":141,"line":183},[17642,17646,17650,17654,17658,17662,17666,17670,17674],{"type":40,"tag":139,"props":17643,"children":17644},{"style":242},[17645],{"type":45,"value":245},{"type":40,"tag":139,"props":17647,"children":17648},{"style":248},[17649],{"type":45,"value":251},{"type":40,"tag":139,"props":17651,"children":17652},{"style":254},[17653],{"type":45,"value":6072},{"type":40,"tag":139,"props":17655,"children":17656},{"style":248},[17657],{"type":45,"value":262},{"type":40,"tag":139,"props":17659,"children":17660},{"style":242},[17661],{"type":45,"value":267},{"type":40,"tag":139,"props":17663,"children":17664},{"style":248},[17665],{"type":45,"value":272},{"type":40,"tag":139,"props":17667,"children":17668},{"style":162},[17669],{"type":45,"value":6089},{"type":40,"tag":139,"props":17671,"children":17672},{"style":248},[17673],{"type":45,"value":281},{"type":40,"tag":139,"props":17675,"children":17676},{"style":248},[17677],{"type":45,"value":286},{"type":40,"tag":139,"props":17679,"children":17680},{"class":141,"line":192},[17681],{"type":40,"tag":139,"props":17682,"children":17683},{"emptyLinePlaceholder":177},[17684],{"type":45,"value":180},{"type":40,"tag":139,"props":17686,"children":17687},{"class":141,"line":995},[17688,17692,17696,17700,17704,17708,17712],{"type":40,"tag":139,"props":17689,"children":17690},{"style":299},[17691],{"type":45,"value":302},{"type":40,"tag":139,"props":17693,"children":17694},{"style":254},[17695],{"type":45,"value":307},{"type":40,"tag":139,"props":17697,"children":17698},{"style":248},[17699],{"type":45,"value":312},{"type":40,"tag":139,"props":17701,"children":17702},{"style":248},[17703],{"type":45,"value":317},{"type":40,"tag":139,"props":17705,"children":17706},{"style":320},[17707],{"type":45,"value":257},{"type":40,"tag":139,"props":17709,"children":17710},{"style":254},[17711],{"type":45,"value":327},{"type":40,"tag":139,"props":17713,"children":17714},{"style":248},[17715],{"type":45,"value":332},{"type":40,"tag":139,"props":17717,"children":17718},{"class":141,"line":1213},[17719,17723,17727,17731,17735,17739,17743],{"type":40,"tag":139,"props":17720,"children":17721},{"style":338},[17722],{"type":45,"value":341},{"type":40,"tag":139,"props":17724,"children":17725},{"style":248},[17726],{"type":45,"value":346},{"type":40,"tag":139,"props":17728,"children":17729},{"style":254},[17730],{"type":45,"value":351},{"type":40,"tag":139,"props":17732,"children":17733},{"style":248},[17734],{"type":45,"value":356},{"type":40,"tag":139,"props":17736,"children":17737},{"style":254},[17738],{"type":45,"value":361},{"type":40,"tag":139,"props":17740,"children":17741},{"style":248},[17742],{"type":45,"value":356},{"type":40,"tag":139,"props":17744,"children":17745},{"style":254},[17746],{"type":45,"value":370},{"type":40,"tag":139,"props":17748,"children":17749},{"class":141,"line":1229},[17750,17754,17758],{"type":40,"tag":139,"props":17751,"children":17752},{"style":248},[17753],{"type":45,"value":378},{"type":40,"tag":139,"props":17755,"children":17756},{"style":254},[17757],{"type":45,"value":383},{"type":40,"tag":139,"props":17759,"children":17760},{"style":248},[17761],{"type":45,"value":286},{"type":40,"tag":139,"props":17763,"children":17764},{"class":141,"line":1237},[17765],{"type":40,"tag":139,"props":17766,"children":17767},{"emptyLinePlaceholder":177},[17768],{"type":45,"value":180},{"type":40,"tag":139,"props":17770,"children":17771},{"class":141,"line":1246},[17772],{"type":40,"tag":139,"props":17773,"children":17774},{"style":146},[17775],{"type":45,"value":17776},"\u002F\u002F Define tools\n",{"type":40,"tag":139,"props":17778,"children":17779},{"class":141,"line":1296},[17780,17784,17788,17792,17796,17800],{"type":40,"tag":139,"props":17781,"children":17782},{"style":299},[17783],{"type":45,"value":302},{"type":40,"tag":139,"props":17785,"children":17786},{"style":254},[17787],{"type":45,"value":7211},{"type":40,"tag":139,"props":17789,"children":17790},{"style":248},[17791],{"type":45,"value":312},{"type":40,"tag":139,"props":17793,"children":17794},{"style":320},[17795],{"type":45,"value":6031},{"type":40,"tag":139,"props":17797,"children":17798},{"style":254},[17799],{"type":45,"value":327},{"type":40,"tag":139,"props":17801,"children":17802},{"style":248},[17803],{"type":45,"value":332},{"type":40,"tag":139,"props":17805,"children":17806},{"class":141,"line":1322},[17807,17811,17815,17819,17823,17827],{"type":40,"tag":139,"props":17808,"children":17809},{"style":338},[17810],{"type":45,"value":1193},{"type":40,"tag":139,"props":17812,"children":17813},{"style":248},[17814],{"type":45,"value":346},{"type":40,"tag":139,"props":17816,"children":17817},{"style":248},[17818],{"type":45,"value":272},{"type":40,"tag":139,"props":17820,"children":17821},{"style":162},[17822],{"type":45,"value":7247},{"type":40,"tag":139,"props":17824,"children":17825},{"style":248},[17826],{"type":45,"value":281},{"type":40,"tag":139,"props":17828,"children":17829},{"style":248},[17830],{"type":45,"value":701},{"type":40,"tag":139,"props":17832,"children":17833},{"class":141,"line":1338},[17834,17838,17842,17846,17851,17855],{"type":40,"tag":139,"props":17835,"children":17836},{"style":338},[17837],{"type":45,"value":6168},{"type":40,"tag":139,"props":17839,"children":17840},{"style":248},[17841],{"type":45,"value":346},{"type":40,"tag":139,"props":17843,"children":17844},{"style":248},[17845],{"type":45,"value":272},{"type":40,"tag":139,"props":17847,"children":17848},{"style":162},[17849],{"type":45,"value":17850},"Search the web for information",{"type":40,"tag":139,"props":17852,"children":17853},{"style":248},[17854],{"type":45,"value":281},{"type":40,"tag":139,"props":17856,"children":17857},{"style":248},[17858],{"type":45,"value":701},{"type":40,"tag":139,"props":17860,"children":17861},{"class":141,"line":1346},[17862,17866,17870,17874,17878,17882,17886],{"type":40,"tag":139,"props":17863,"children":17864},{"style":338},[17865],{"type":45,"value":6197},{"type":40,"tag":139,"props":17867,"children":17868},{"style":248},[17869],{"type":45,"value":346},{"type":40,"tag":139,"props":17871,"children":17872},{"style":254},[17873],{"type":45,"value":6072},{"type":40,"tag":139,"props":17875,"children":17876},{"style":248},[17877],{"type":45,"value":356},{"type":40,"tag":139,"props":17879,"children":17880},{"style":320},[17881],{"type":45,"value":6214},{"type":40,"tag":139,"props":17883,"children":17884},{"style":254},[17885],{"type":45,"value":327},{"type":40,"tag":139,"props":17887,"children":17888},{"style":248},[17889],{"type":45,"value":332},{"type":40,"tag":139,"props":17891,"children":17892},{"class":141,"line":1355},[17893,17898,17902,17906,17910,17914,17918,17922,17926,17930,17934,17939,17943],{"type":40,"tag":139,"props":17894,"children":17895},{"style":338},[17896],{"type":45,"value":17897},"    query",{"type":40,"tag":139,"props":17899,"children":17900},{"style":248},[17901],{"type":45,"value":346},{"type":40,"tag":139,"props":17903,"children":17904},{"style":254},[17905],{"type":45,"value":6072},{"type":40,"tag":139,"props":17907,"children":17908},{"style":248},[17909],{"type":45,"value":356},{"type":40,"tag":139,"props":17911,"children":17912},{"style":320},[17913],{"type":45,"value":1858},{"type":40,"tag":139,"props":17915,"children":17916},{"style":254},[17917],{"type":45,"value":931},{"type":40,"tag":139,"props":17919,"children":17920},{"style":248},[17921],{"type":45,"value":356},{"type":40,"tag":139,"props":17923,"children":17924},{"style":320},[17925],{"type":45,"value":6259},{"type":40,"tag":139,"props":17927,"children":17928},{"style":254},[17929],{"type":45,"value":327},{"type":40,"tag":139,"props":17931,"children":17932},{"style":248},[17933],{"type":45,"value":281},{"type":40,"tag":139,"props":17935,"children":17936},{"style":162},[17937],{"type":45,"value":17938},"Search query",{"type":40,"tag":139,"props":17940,"children":17941},{"style":248},[17942],{"type":45,"value":281},{"type":40,"tag":139,"props":17944,"children":17945},{"style":254},[17946],{"type":45,"value":6392},{"type":40,"tag":139,"props":17948,"children":17949},{"class":141,"line":1393},[17950,17954,17958],{"type":40,"tag":139,"props":17951,"children":17952},{"style":248},[17953],{"type":45,"value":2746},{"type":40,"tag":139,"props":17955,"children":17956},{"style":254},[17957],{"type":45,"value":383},{"type":40,"tag":139,"props":17959,"children":17960},{"style":248},[17961],{"type":45,"value":701},{"type":40,"tag":139,"props":17963,"children":17964},{"class":141,"line":1421},[17965,17969,17973,17977,17981,17985,17989],{"type":40,"tag":139,"props":17966,"children":17967},{"style":338},[17968],{"type":45,"value":6415},{"type":40,"tag":139,"props":17970,"children":17971},{"style":248},[17972],{"type":45,"value":346},{"type":40,"tag":139,"props":17974,"children":17975},{"style":254},[17976],{"type":45,"value":6072},{"type":40,"tag":139,"props":17978,"children":17979},{"style":248},[17980],{"type":45,"value":356},{"type":40,"tag":139,"props":17982,"children":17983},{"style":320},[17984],{"type":45,"value":6214},{"type":40,"tag":139,"props":17986,"children":17987},{"style":254},[17988],{"type":45,"value":327},{"type":40,"tag":139,"props":17990,"children":17991},{"style":248},[17992],{"type":45,"value":332},{"type":40,"tag":139,"props":17994,"children":17995},{"class":141,"line":1439},[17996,18001,18005,18009,18013,18017,18021,18025,18029,18033],{"type":40,"tag":139,"props":17997,"children":17998},{"style":338},[17999],{"type":45,"value":18000},"    results",{"type":40,"tag":139,"props":18002,"children":18003},{"style":248},[18004],{"type":45,"value":346},{"type":40,"tag":139,"props":18006,"children":18007},{"style":254},[18008],{"type":45,"value":6072},{"type":40,"tag":139,"props":18010,"children":18011},{"style":248},[18012],{"type":45,"value":356},{"type":40,"tag":139,"props":18014,"children":18015},{"style":320},[18016],{"type":45,"value":7530},{"type":40,"tag":139,"props":18018,"children":18019},{"style":254},[18020],{"type":45,"value":7535},{"type":40,"tag":139,"props":18022,"children":18023},{"style":248},[18024],{"type":45,"value":356},{"type":40,"tag":139,"props":18026,"children":18027},{"style":320},[18028],{"type":45,"value":6214},{"type":40,"tag":139,"props":18030,"children":18031},{"style":254},[18032],{"type":45,"value":327},{"type":40,"tag":139,"props":18034,"children":18035},{"style":248},[18036],{"type":45,"value":332},{"type":40,"tag":139,"props":18038,"children":18039},{"class":141,"line":1465},[18040,18045,18049,18053,18057,18061,18065],{"type":40,"tag":139,"props":18041,"children":18042},{"style":338},[18043],{"type":45,"value":18044},"      title",{"type":40,"tag":139,"props":18046,"children":18047},{"style":248},[18048],{"type":45,"value":346},{"type":40,"tag":139,"props":18050,"children":18051},{"style":254},[18052],{"type":45,"value":6072},{"type":40,"tag":139,"props":18054,"children":18055},{"style":248},[18056],{"type":45,"value":356},{"type":40,"tag":139,"props":18058,"children":18059},{"style":320},[18060],{"type":45,"value":1858},{"type":40,"tag":139,"props":18062,"children":18063},{"style":254},[18064],{"type":45,"value":931},{"type":40,"tag":139,"props":18066,"children":18067},{"style":248},[18068],{"type":45,"value":701},{"type":40,"tag":139,"props":18070,"children":18071},{"class":141,"line":1474},[18072,18077,18081,18085,18089,18093,18097],{"type":40,"tag":139,"props":18073,"children":18074},{"style":338},[18075],{"type":45,"value":18076},"      snippet",{"type":40,"tag":139,"props":18078,"children":18079},{"style":248},[18080],{"type":45,"value":346},{"type":40,"tag":139,"props":18082,"children":18083},{"style":254},[18084],{"type":45,"value":6072},{"type":40,"tag":139,"props":18086,"children":18087},{"style":248},[18088],{"type":45,"value":356},{"type":40,"tag":139,"props":18090,"children":18091},{"style":320},[18092],{"type":45,"value":1858},{"type":40,"tag":139,"props":18094,"children":18095},{"style":254},[18096],{"type":45,"value":931},{"type":40,"tag":139,"props":18098,"children":18099},{"style":248},[18100],{"type":45,"value":701},{"type":40,"tag":139,"props":18102,"children":18103},{"class":141,"line":1490},[18104,18109,18113,18117,18121,18125],{"type":40,"tag":139,"props":18105,"children":18106},{"style":338},[18107],{"type":45,"value":18108},"      url",{"type":40,"tag":139,"props":18110,"children":18111},{"style":248},[18112],{"type":45,"value":346},{"type":40,"tag":139,"props":18114,"children":18115},{"style":254},[18116],{"type":45,"value":6072},{"type":40,"tag":139,"props":18118,"children":18119},{"style":248},[18120],{"type":45,"value":356},{"type":40,"tag":139,"props":18122,"children":18123},{"style":320},[18124],{"type":45,"value":1858},{"type":40,"tag":139,"props":18126,"children":18127},{"style":254},[18128],{"type":45,"value":6533},{"type":40,"tag":139,"props":18130,"children":18131},{"class":141,"line":1498},[18132,18136],{"type":40,"tag":139,"props":18133,"children":18134},{"style":248},[18135],{"type":45,"value":3229},{"type":40,"tag":139,"props":18137,"children":18138},{"style":254},[18139],{"type":45,"value":18140},"))\n",{"type":40,"tag":139,"props":18142,"children":18143},{"class":141,"line":1507},[18144,18148,18152],{"type":40,"tag":139,"props":18145,"children":18146},{"style":248},[18147],{"type":45,"value":2746},{"type":40,"tag":139,"props":18149,"children":18150},{"style":254},[18151],{"type":45,"value":383},{"type":40,"tag":139,"props":18153,"children":18154},{"style":248},[18155],{"type":45,"value":701},{"type":40,"tag":139,"props":18157,"children":18158},{"class":141,"line":1544},[18159,18163,18167,18171,18175,18179,18183,18187],{"type":40,"tag":139,"props":18160,"children":18161},{"style":320},[18162],{"type":45,"value":6556},{"type":40,"tag":139,"props":18164,"children":18165},{"style":248},[18166],{"type":45,"value":346},{"type":40,"tag":139,"props":18168,"children":18169},{"style":299},[18170],{"type":45,"value":2632},{"type":40,"tag":139,"props":18172,"children":18173},{"style":248},[18174],{"type":45,"value":7092},{"type":40,"tag":139,"props":18176,"children":18177},{"style":2640},[18178],{"type":45,"value":7319},{"type":40,"tag":139,"props":18180,"children":18181},{"style":248},[18182],{"type":45,"value":7102},{"type":40,"tag":139,"props":18184,"children":18185},{"style":299},[18186],{"type":45,"value":2661},{"type":40,"tag":139,"props":18188,"children":18189},{"style":248},[18190],{"type":45,"value":1436},{"type":40,"tag":139,"props":18192,"children":18193},{"class":141,"line":1568},[18194],{"type":40,"tag":139,"props":18195,"children":18196},{"style":146},[18197],{"type":45,"value":18198},"    \u002F\u002F Implement actual search\n",{"type":40,"tag":139,"props":18200,"children":18201},{"class":141,"line":27},[18202,18206],{"type":40,"tag":139,"props":18203,"children":18204},{"style":242},[18205],{"type":45,"value":3055},{"type":40,"tag":139,"props":18207,"children":18208},{"style":248},[18209],{"type":45,"value":1436},{"type":40,"tag":139,"props":18211,"children":18212},{"class":141,"line":3010},[18213,18218,18222],{"type":40,"tag":139,"props":18214,"children":18215},{"style":338},[18216],{"type":45,"value":18217},"      results",{"type":40,"tag":139,"props":18219,"children":18220},{"style":248},[18221],{"type":45,"value":346},{"type":40,"tag":139,"props":18223,"children":18224},{"style":338},[18225],{"type":45,"value":4523},{"type":40,"tag":139,"props":18227,"children":18228},{"class":141,"line":3018},[18229,18233,18238,18242,18246,18251,18255,18259,18264,18268,18272,18277,18281,18285,18289,18293,18297,18302,18306],{"type":40,"tag":139,"props":18230,"children":18231},{"style":248},[18232],{"type":45,"value":4876},{"type":40,"tag":139,"props":18234,"children":18235},{"style":338},[18236],{"type":45,"value":18237}," title",{"type":40,"tag":139,"props":18239,"children":18240},{"style":248},[18241],{"type":45,"value":346},{"type":40,"tag":139,"props":18243,"children":18244},{"style":248},[18245],{"type":45,"value":272},{"type":40,"tag":139,"props":18247,"children":18248},{"style":162},[18249],{"type":45,"value":18250},"Example",{"type":40,"tag":139,"props":18252,"children":18253},{"style":248},[18254],{"type":45,"value":281},{"type":40,"tag":139,"props":18256,"children":18257},{"style":248},[18258],{"type":45,"value":974},{"type":40,"tag":139,"props":18260,"children":18261},{"style":338},[18262],{"type":45,"value":18263}," snippet",{"type":40,"tag":139,"props":18265,"children":18266},{"style":248},[18267],{"type":45,"value":346},{"type":40,"tag":139,"props":18269,"children":18270},{"style":248},[18271],{"type":45,"value":272},{"type":40,"tag":139,"props":18273,"children":18274},{"style":162},[18275],{"type":45,"value":18276},"Example result",{"type":40,"tag":139,"props":18278,"children":18279},{"style":248},[18280],{"type":45,"value":281},{"type":40,"tag":139,"props":18282,"children":18283},{"style":248},[18284],{"type":45,"value":974},{"type":40,"tag":139,"props":18286,"children":18287},{"style":338},[18288],{"type":45,"value":4976},{"type":40,"tag":139,"props":18290,"children":18291},{"style":248},[18292],{"type":45,"value":346},{"type":40,"tag":139,"props":18294,"children":18295},{"style":248},[18296],{"type":45,"value":272},{"type":40,"tag":139,"props":18298,"children":18299},{"style":162},[18300],{"type":45,"value":18301},"https:\u002F\u002Fexample.com",{"type":40,"tag":139,"props":18303,"children":18304},{"style":248},[18305],{"type":45,"value":281},{"type":40,"tag":139,"props":18307,"children":18308},{"style":248},[18309],{"type":45,"value":4698},{"type":40,"tag":139,"props":18311,"children":18312},{"class":141,"line":3049},[18313],{"type":40,"tag":139,"props":18314,"children":18315},{"style":338},[18316],{"type":45,"value":5009},{"type":40,"tag":139,"props":18318,"children":18319},{"class":141,"line":3119},[18320],{"type":40,"tag":139,"props":18321,"children":18322},{"style":248},[18323],{"type":45,"value":6679},{"type":40,"tag":139,"props":18325,"children":18326},{"class":141,"line":3127},[18327],{"type":40,"tag":139,"props":18328,"children":18329},{"style":248},[18330],{"type":45,"value":1471},{"type":40,"tag":139,"props":18332,"children":18333},{"class":141,"line":3135},[18334,18338,18342],{"type":40,"tag":139,"props":18335,"children":18336},{"style":248},[18337],{"type":45,"value":378},{"type":40,"tag":139,"props":18339,"children":18340},{"style":254},[18341],{"type":45,"value":383},{"type":40,"tag":139,"props":18343,"children":18344},{"style":248},[18345],{"type":45,"value":286},{"type":40,"tag":139,"props":18347,"children":18348},{"class":141,"line":3148},[18349],{"type":40,"tag":139,"props":18350,"children":18351},{"emptyLinePlaceholder":177},[18352],{"type":45,"value":180},{"type":40,"tag":139,"props":18354,"children":18355},{"class":141,"line":3197},[18356,18360,18365,18369,18373,18377],{"type":40,"tag":139,"props":18357,"children":18358},{"style":299},[18359],{"type":45,"value":302},{"type":40,"tag":139,"props":18361,"children":18362},{"style":254},[18363],{"type":45,"value":18364}," finishTool ",{"type":40,"tag":139,"props":18366,"children":18367},{"style":248},[18368],{"type":45,"value":312},{"type":40,"tag":139,"props":18370,"children":18371},{"style":320},[18372],{"type":45,"value":6031},{"type":40,"tag":139,"props":18374,"children":18375},{"style":254},[18376],{"type":45,"value":327},{"type":40,"tag":139,"props":18378,"children":18379},{"style":248},[18380],{"type":45,"value":332},{"type":40,"tag":139,"props":18382,"children":18383},{"class":141,"line":3223},[18384,18388,18392,18396,18400,18404],{"type":40,"tag":139,"props":18385,"children":18386},{"style":338},[18387],{"type":45,"value":1193},{"type":40,"tag":139,"props":18389,"children":18390},{"style":248},[18391],{"type":45,"value":346},{"type":40,"tag":139,"props":18393,"children":18394},{"style":248},[18395],{"type":45,"value":272},{"type":40,"tag":139,"props":18397,"children":18398},{"style":162},[18399],{"type":45,"value":8320},{"type":40,"tag":139,"props":18401,"children":18402},{"style":248},[18403],{"type":45,"value":281},{"type":40,"tag":139,"props":18405,"children":18406},{"style":248},[18407],{"type":45,"value":701},{"type":40,"tag":139,"props":18409,"children":18410},{"class":141,"line":3240},[18411,18415,18419,18423,18428,18432],{"type":40,"tag":139,"props":18412,"children":18413},{"style":338},[18414],{"type":45,"value":6168},{"type":40,"tag":139,"props":18416,"children":18417},{"style":248},[18418],{"type":45,"value":346},{"type":40,"tag":139,"props":18420,"children":18421},{"style":248},[18422],{"type":45,"value":272},{"type":40,"tag":139,"props":18424,"children":18425},{"style":162},[18426],{"type":45,"value":18427},"Complete the task with final answer",{"type":40,"tag":139,"props":18429,"children":18430},{"style":248},[18431],{"type":45,"value":281},{"type":40,"tag":139,"props":18433,"children":18434},{"style":248},[18435],{"type":45,"value":701},{"type":40,"tag":139,"props":18437,"children":18438},{"class":141,"line":3248},[18439,18443,18447,18451,18455,18459,18463],{"type":40,"tag":139,"props":18440,"children":18441},{"style":338},[18442],{"type":45,"value":6197},{"type":40,"tag":139,"props":18444,"children":18445},{"style":248},[18446],{"type":45,"value":346},{"type":40,"tag":139,"props":18448,"children":18449},{"style":254},[18450],{"type":45,"value":6072},{"type":40,"tag":139,"props":18452,"children":18453},{"style":248},[18454],{"type":45,"value":356},{"type":40,"tag":139,"props":18456,"children":18457},{"style":320},[18458],{"type":45,"value":6214},{"type":40,"tag":139,"props":18460,"children":18461},{"style":254},[18462],{"type":45,"value":327},{"type":40,"tag":139,"props":18464,"children":18465},{"style":248},[18466],{"type":45,"value":332},{"type":40,"tag":139,"props":18468,"children":18469},{"class":141,"line":3257},[18470,18475,18479,18483,18487,18491,18495,18499,18503,18507,18511,18516,18520],{"type":40,"tag":139,"props":18471,"children":18472},{"style":338},[18473],{"type":45,"value":18474},"    answer",{"type":40,"tag":139,"props":18476,"children":18477},{"style":248},[18478],{"type":45,"value":346},{"type":40,"tag":139,"props":18480,"children":18481},{"style":254},[18482],{"type":45,"value":6072},{"type":40,"tag":139,"props":18484,"children":18485},{"style":248},[18486],{"type":45,"value":356},{"type":40,"tag":139,"props":18488,"children":18489},{"style":320},[18490],{"type":45,"value":1858},{"type":40,"tag":139,"props":18492,"children":18493},{"style":254},[18494],{"type":45,"value":931},{"type":40,"tag":139,"props":18496,"children":18497},{"style":248},[18498],{"type":45,"value":356},{"type":40,"tag":139,"props":18500,"children":18501},{"style":320},[18502],{"type":45,"value":6259},{"type":40,"tag":139,"props":18504,"children":18505},{"style":254},[18506],{"type":45,"value":327},{"type":40,"tag":139,"props":18508,"children":18509},{"style":248},[18510],{"type":45,"value":281},{"type":40,"tag":139,"props":18512,"children":18513},{"style":162},[18514],{"type":45,"value":18515},"The final answer",{"type":40,"tag":139,"props":18517,"children":18518},{"style":248},[18519],{"type":45,"value":281},{"type":40,"tag":139,"props":18521,"children":18522},{"style":254},[18523],{"type":45,"value":6392},{"type":40,"tag":139,"props":18525,"children":18526},{"class":141,"line":3319},[18527,18531,18535],{"type":40,"tag":139,"props":18528,"children":18529},{"style":248},[18530],{"type":45,"value":2746},{"type":40,"tag":139,"props":18532,"children":18533},{"style":254},[18534],{"type":45,"value":383},{"type":40,"tag":139,"props":18536,"children":18537},{"style":248},[18538],{"type":45,"value":701},{"type":40,"tag":139,"props":18540,"children":18541},{"class":141,"line":3327},[18542,18546,18550,18554,18558,18563,18567,18571,18575,18579,18584,18588],{"type":40,"tag":139,"props":18543,"children":18544},{"style":320},[18545],{"type":45,"value":6556},{"type":40,"tag":139,"props":18547,"children":18548},{"style":248},[18549],{"type":45,"value":346},{"type":40,"tag":139,"props":18551,"children":18552},{"style":299},[18553],{"type":45,"value":2632},{"type":40,"tag":139,"props":18555,"children":18556},{"style":248},[18557],{"type":45,"value":7092},{"type":40,"tag":139,"props":18559,"children":18560},{"style":2640},[18561],{"type":45,"value":18562}," answer",{"type":40,"tag":139,"props":18564,"children":18565},{"style":248},[18566],{"type":45,"value":7102},{"type":40,"tag":139,"props":18568,"children":18569},{"style":299},[18570],{"type":45,"value":2661},{"type":40,"tag":139,"props":18572,"children":18573},{"style":254},[18574],{"type":45,"value":2637},{"type":40,"tag":139,"props":18576,"children":18577},{"style":248},[18578],{"type":45,"value":833},{"type":40,"tag":139,"props":18580,"children":18581},{"style":254},[18582],{"type":45,"value":18583}," answer ",{"type":40,"tag":139,"props":18585,"children":18586},{"style":248},[18587],{"type":45,"value":378},{"type":40,"tag":139,"props":18589,"children":18590},{"style":254},[18591],{"type":45,"value":6392},{"type":40,"tag":139,"props":18593,"children":18594},{"class":141,"line":3369},[18595,18599,18603],{"type":40,"tag":139,"props":18596,"children":18597},{"style":248},[18598],{"type":45,"value":378},{"type":40,"tag":139,"props":18600,"children":18601},{"style":254},[18602],{"type":45,"value":383},{"type":40,"tag":139,"props":18604,"children":18605},{"style":248},[18606],{"type":45,"value":286},{"type":40,"tag":139,"props":18608,"children":18609},{"class":141,"line":3399},[18610],{"type":40,"tag":139,"props":18611,"children":18612},{"emptyLinePlaceholder":177},[18613],{"type":45,"value":180},{"type":40,"tag":139,"props":18615,"children":18616},{"class":141,"line":3450},[18617],{"type":40,"tag":139,"props":18618,"children":18619},{"style":146},[18620],{"type":45,"value":18621},"\u002F\u002F Run agent\n",{"type":40,"tag":139,"props":18623,"children":18624},{"class":141,"line":3491},[18625,18629,18633,18638,18642,18647,18651,18655,18659],{"type":40,"tag":139,"props":18626,"children":18627},{"style":299},[18628],{"type":45,"value":10020},{"type":40,"tag":139,"props":18630,"children":18631},{"style":299},[18632],{"type":45,"value":7579},{"type":40,"tag":139,"props":18634,"children":18635},{"style":320},[18636],{"type":45,"value":18637}," runAgent",{"type":40,"tag":139,"props":18639,"children":18640},{"style":248},[18641],{"type":45,"value":327},{"type":40,"tag":139,"props":18643,"children":18644},{"style":2640},[18645],{"type":45,"value":18646},"task",{"type":40,"tag":139,"props":18648,"children":18649},{"style":248},[18650],{"type":45,"value":346},{"type":40,"tag":139,"props":18652,"children":18653},{"style":156},[18654],{"type":45,"value":11506},{"type":40,"tag":139,"props":18656,"children":18657},{"style":248},[18658],{"type":45,"value":383},{"type":40,"tag":139,"props":18660,"children":18661},{"style":248},[18662],{"type":45,"value":1436},{"type":40,"tag":139,"props":18664,"children":18665},{"class":141,"line":3499},[18666,18670,18674,18678,18682,18686,18690,18694],{"type":40,"tag":139,"props":18667,"children":18668},{"style":299},[18669],{"type":45,"value":2673},{"type":40,"tag":139,"props":18671,"children":18672},{"style":254},[18673],{"type":45,"value":3762},{"type":40,"tag":139,"props":18675,"children":18676},{"style":248},[18677],{"type":45,"value":2682},{"type":40,"tag":139,"props":18679,"children":18680},{"style":254},[18681],{"type":45,"value":655},{"type":40,"tag":139,"props":18683,"children":18684},{"style":248},[18685],{"type":45,"value":356},{"type":40,"tag":139,"props":18687,"children":18688},{"style":320},[18689],{"type":45,"value":59},{"type":40,"tag":139,"props":18691,"children":18692},{"style":338},[18693],{"type":45,"value":327},{"type":40,"tag":139,"props":18695,"children":18696},{"style":248},[18697],{"type":45,"value":332},{"type":40,"tag":139,"props":18699,"children":18700},{"class":141,"line":3515},[18701,18705,18709,18713,18717,18721],{"type":40,"tag":139,"props":18702,"children":18703},{"style":338},[18704],{"type":45,"value":3795},{"type":40,"tag":139,"props":18706,"children":18707},{"style":248},[18708],{"type":45,"value":346},{"type":40,"tag":139,"props":18710,"children":18711},{"style":248},[18712],{"type":45,"value":272},{"type":40,"tag":139,"props":18714,"children":18715},{"style":162},[18716],{"type":45,"value":692},{"type":40,"tag":139,"props":18718,"children":18719},{"style":248},[18720],{"type":45,"value":281},{"type":40,"tag":139,"props":18722,"children":18723},{"style":248},[18724],{"type":45,"value":701},{"type":40,"tag":139,"props":18726,"children":18727},{"class":141,"line":3523},[18728,18732,18736,18740,18745,18749],{"type":40,"tag":139,"props":18729,"children":18730},{"style":338},[18731],{"type":45,"value":9285},{"type":40,"tag":139,"props":18733,"children":18734},{"style":248},[18735],{"type":45,"value":346},{"type":40,"tag":139,"props":18737,"children":18738},{"style":248},[18739],{"type":45,"value":272},{"type":40,"tag":139,"props":18741,"children":18742},{"style":162},[18743],{"type":45,"value":18744},"You are a helpful research assistant. Use web_search to find information, then use finish to provide your final answer.",{"type":40,"tag":139,"props":18746,"children":18747},{"style":248},[18748],{"type":45,"value":281},{"type":40,"tag":139,"props":18750,"children":18751},{"style":248},[18752],{"type":45,"value":701},{"type":40,"tag":139,"props":18754,"children":18755},{"class":141,"line":3532},[18756,18760,18764,18769],{"type":40,"tag":139,"props":18757,"children":18758},{"style":338},[18759],{"type":45,"value":3824},{"type":40,"tag":139,"props":18761,"children":18762},{"style":248},[18763],{"type":45,"value":346},{"type":40,"tag":139,"props":18765,"children":18766},{"style":254},[18767],{"type":45,"value":18768}," task",{"type":40,"tag":139,"props":18770,"children":18771},{"style":248},[18772],{"type":45,"value":701},{"type":40,"tag":139,"props":18774,"children":18775},{"class":141,"line":3602},[18776,18781,18785,18789,18794,18798,18803,18807],{"type":40,"tag":139,"props":18777,"children":18778},{"style":338},[18779],{"type":45,"value":18780},"    tools",{"type":40,"tag":139,"props":18782,"children":18783},{"style":248},[18784],{"type":45,"value":346},{"type":40,"tag":139,"props":18786,"children":18787},{"style":338},[18788],{"type":45,"value":7746},{"type":40,"tag":139,"props":18790,"children":18791},{"style":254},[18792],{"type":45,"value":18793},"searchTool",{"type":40,"tag":139,"props":18795,"children":18796},{"style":248},[18797],{"type":45,"value":974},{"type":40,"tag":139,"props":18799,"children":18800},{"style":254},[18801],{"type":45,"value":18802}," finishTool",{"type":40,"tag":139,"props":18804,"children":18805},{"style":338},[18806],{"type":45,"value":10233},{"type":40,"tag":139,"props":18808,"children":18809},{"style":248},[18810],{"type":45,"value":701},{"type":40,"tag":139,"props":18812,"children":18813},{"class":141,"line":3660},[18814,18819,18823],{"type":40,"tag":139,"props":18815,"children":18816},{"style":338},[18817],{"type":45,"value":18818},"    stopWhen",{"type":40,"tag":139,"props":18820,"children":18821},{"style":248},[18822],{"type":45,"value":346},{"type":40,"tag":139,"props":18824,"children":18825},{"style":338},[18826],{"type":45,"value":4523},{"type":40,"tag":139,"props":18828,"children":18829},{"class":141,"line":3668},[18830,18835,18839,18843,18847],{"type":40,"tag":139,"props":18831,"children":18832},{"style":320},[18833],{"type":45,"value":18834},"      stepCountIs",{"type":40,"tag":139,"props":18836,"children":18837},{"style":338},[18838],{"type":45,"value":327},{"type":40,"tag":139,"props":18840,"children":18841},{"style":3075},[18842],{"type":45,"value":8256},{"type":40,"tag":139,"props":18844,"children":18845},{"style":338},[18846],{"type":45,"value":383},{"type":40,"tag":139,"props":18848,"children":18849},{"style":248},[18850],{"type":45,"value":701},{"type":40,"tag":139,"props":18852,"children":18853},{"class":141,"line":3677},[18854,18859,18863,18867,18871,18875],{"type":40,"tag":139,"props":18855,"children":18856},{"style":320},[18857],{"type":45,"value":18858},"      hasToolCall",{"type":40,"tag":139,"props":18860,"children":18861},{"style":338},[18862],{"type":45,"value":327},{"type":40,"tag":139,"props":18864,"children":18865},{"style":248},[18866],{"type":45,"value":281},{"type":40,"tag":139,"props":18868,"children":18869},{"style":162},[18870],{"type":45,"value":8320},{"type":40,"tag":139,"props":18872,"children":18873},{"style":248},[18874],{"type":45,"value":281},{"type":40,"tag":139,"props":18876,"children":18877},{"style":338},[18878],{"type":45,"value":6392},{"type":40,"tag":139,"props":18880,"children":18881},{"class":141,"line":3710},[18882],{"type":40,"tag":139,"props":18883,"children":18884},{"style":338},[18885],{"type":45,"value":18886},"    ]\n",{"type":40,"tag":139,"props":18888,"children":18889},{"class":141,"line":3728},[18890,18894,18898],{"type":40,"tag":139,"props":18891,"children":18892},{"style":248},[18893],{"type":45,"value":2746},{"type":40,"tag":139,"props":18895,"children":18896},{"style":338},[18897],{"type":45,"value":383},{"type":40,"tag":139,"props":18899,"children":18900},{"style":248},[18901],{"type":45,"value":286},{"type":40,"tag":139,"props":18903,"children":18904},{"class":141,"line":3744},[18905],{"type":40,"tag":139,"props":18906,"children":18907},{"emptyLinePlaceholder":177},[18908],{"type":45,"value":180},{"type":40,"tag":139,"props":18910,"children":18911},{"class":141,"line":3752},[18912],{"type":40,"tag":139,"props":18913,"children":18914},{"style":146},[18915],{"type":45,"value":18916},"  \u002F\u002F Stream progress\n",{"type":40,"tag":139,"props":18918,"children":18919},{"class":141,"line":3789},[18920,18924,18928,18932,18936,18941,18945,18949,18953,18957,18961],{"type":40,"tag":139,"props":18921,"children":18922},{"style":242},[18923],{"type":45,"value":10041},{"type":40,"tag":139,"props":18925,"children":18926},{"style":242},[18927],{"type":45,"value":903},{"type":40,"tag":139,"props":18929,"children":18930},{"style":338},[18931],{"type":45,"value":2637},{"type":40,"tag":139,"props":18933,"children":18934},{"style":299},[18935],{"type":45,"value":302},{"type":40,"tag":139,"props":18937,"children":18938},{"style":254},[18939],{"type":45,"value":18940}," toolCall",{"type":40,"tag":139,"props":18942,"children":18943},{"style":248},[18944],{"type":45,"value":10063},{"type":40,"tag":139,"props":18946,"children":18947},{"style":254},[18948],{"type":45,"value":3762},{"type":40,"tag":139,"props":18950,"children":18951},{"style":248},[18952],{"type":45,"value":356},{"type":40,"tag":139,"props":18954,"children":18955},{"style":320},[18956],{"type":45,"value":10521},{"type":40,"tag":139,"props":18958,"children":18959},{"style":338},[18960],{"type":45,"value":5933},{"type":40,"tag":139,"props":18962,"children":18963},{"style":248},[18964],{"type":45,"value":332},{"type":40,"tag":139,"props":18966,"children":18967},{"class":141,"line":3818},[18968,18972,18976,18980,18984,18988,18993,18997,19001,19005,19009,19013,19017,19021,19025,19029,19033,19037,19041,19045,19049,19053],{"type":40,"tag":139,"props":18969,"children":18970},{"style":254},[18971],{"type":45,"value":3405},{"type":40,"tag":139,"props":18973,"children":18974},{"style":248},[18975],{"type":45,"value":356},{"type":40,"tag":139,"props":18977,"children":18978},{"style":320},[18979],{"type":45,"value":952},{"type":40,"tag":139,"props":18981,"children":18982},{"style":338},[18983],{"type":45,"value":327},{"type":40,"tag":139,"props":18985,"children":18986},{"style":248},[18987],{"type":45,"value":10554},{"type":40,"tag":139,"props":18989,"children":18990},{"style":162},[18991],{"type":45,"value":18992},"[",{"type":40,"tag":139,"props":18994,"children":18995},{"style":248},[18996],{"type":45,"value":9403},{"type":40,"tag":139,"props":18998,"children":18999},{"style":254},[19000],{"type":45,"value":10568},{"type":40,"tag":139,"props":19002,"children":19003},{"style":248},[19004],{"type":45,"value":356},{"type":40,"tag":139,"props":19006,"children":19007},{"style":254},[19008],{"type":45,"value":10577},{"type":40,"tag":139,"props":19010,"children":19011},{"style":248},[19012],{"type":45,"value":378},{"type":40,"tag":139,"props":19014,"children":19015},{"style":162},[19016],{"type":45,"value":7781},{"type":40,"tag":139,"props":19018,"children":19019},{"style":248},[19020],{"type":45,"value":9403},{"type":40,"tag":139,"props":19022,"children":19023},{"style":254},[19024],{"type":45,"value":10626},{"type":40,"tag":139,"props":19026,"children":19027},{"style":248},[19028],{"type":45,"value":356},{"type":40,"tag":139,"props":19030,"children":19031},{"style":320},[19032],{"type":45,"value":10635},{"type":40,"tag":139,"props":19034,"children":19035},{"style":254},[19036],{"type":45,"value":10640},{"type":40,"tag":139,"props":19038,"children":19039},{"style":248},[19040],{"type":45,"value":356},{"type":40,"tag":139,"props":19042,"children":19043},{"style":254},[19044],{"type":45,"value":10649},{"type":40,"tag":139,"props":19046,"children":19047},{"style":248},[19048],{"type":45,"value":9413},{"type":40,"tag":139,"props":19050,"children":19051},{"style":338},[19052],{"type":45,"value":383},{"type":40,"tag":139,"props":19054,"children":19055},{"style":248},[19056],{"type":45,"value":286},{"type":40,"tag":139,"props":19058,"children":19059},{"class":141,"line":3853},[19060],{"type":40,"tag":139,"props":19061,"children":19062},{"style":248},[19063],{"type":45,"value":1471},{"type":40,"tag":139,"props":19065,"children":19066},{"class":141,"line":3869},[19067],{"type":40,"tag":139,"props":19068,"children":19069},{"emptyLinePlaceholder":177},[19070],{"type":45,"value":180},{"type":40,"tag":139,"props":19072,"children":19073},{"class":141,"line":3877},[19074,19078,19082,19086,19090,19094,19098],{"type":40,"tag":139,"props":19075,"children":19076},{"style":242},[19077],{"type":45,"value":8491},{"type":40,"tag":139,"props":19079,"children":19080},{"style":242},[19081],{"type":45,"value":903},{"type":40,"tag":139,"props":19083,"children":19084},{"style":254},[19085],{"type":45,"value":3762},{"type":40,"tag":139,"props":19087,"children":19088},{"style":248},[19089],{"type":45,"value":356},{"type":40,"tag":139,"props":19091,"children":19092},{"style":320},[19093],{"type":45,"value":3908},{"type":40,"tag":139,"props":19095,"children":19096},{"style":338},[19097],{"type":45,"value":931},{"type":40,"tag":139,"props":19099,"children":19100},{"style":248},[19101],{"type":45,"value":286},{"type":40,"tag":139,"props":19103,"children":19104},{"class":141,"line":3919},[19105],{"type":40,"tag":139,"props":19106,"children":19107},{"style":248},[19108],{"type":45,"value":5988},{"type":40,"tag":139,"props":19110,"children":19111},{"class":141,"line":3969},[19112],{"type":40,"tag":139,"props":19113,"children":19114},{"emptyLinePlaceholder":177},[19115],{"type":45,"value":180},{"type":40,"tag":139,"props":19117,"children":19119},{"class":141,"line":19118},64,[19120],{"type":40,"tag":139,"props":19121,"children":19122},{"style":146},[19123],{"type":45,"value":19124},"\u002F\u002F Usage\n",{"type":40,"tag":139,"props":19126,"children":19128},{"class":141,"line":19127},65,[19129,19133,19137,19141,19145,19149,19153,19157,19162,19166,19170],{"type":40,"tag":139,"props":19130,"children":19131},{"style":299},[19132],{"type":45,"value":302},{"type":40,"tag":139,"props":19134,"children":19135},{"style":254},[19136],{"type":45,"value":18583},{"type":40,"tag":139,"props":19138,"children":19139},{"style":248},[19140],{"type":45,"value":312},{"type":40,"tag":139,"props":19142,"children":19143},{"style":242},[19144],{"type":45,"value":903},{"type":40,"tag":139,"props":19146,"children":19147},{"style":320},[19148],{"type":45,"value":18637},{"type":40,"tag":139,"props":19150,"children":19151},{"style":254},[19152],{"type":45,"value":327},{"type":40,"tag":139,"props":19154,"children":19155},{"style":248},[19156],{"type":45,"value":281},{"type":40,"tag":139,"props":19158,"children":19159},{"style":162},[19160],{"type":45,"value":19161},"What are the latest developments in quantum computing?",{"type":40,"tag":139,"props":19163,"children":19164},{"style":248},[19165],{"type":45,"value":281},{"type":40,"tag":139,"props":19167,"children":19168},{"style":254},[19169],{"type":45,"value":383},{"type":40,"tag":139,"props":19171,"children":19172},{"style":248},[19173],{"type":45,"value":286},{"type":40,"tag":139,"props":19175,"children":19177},{"class":141,"line":19176},66,[19178,19182,19186,19190,19194,19198,19203,19207,19211,19216],{"type":40,"tag":139,"props":19179,"children":19180},{"style":254},[19181],{"type":45,"value":943},{"type":40,"tag":139,"props":19183,"children":19184},{"style":248},[19185],{"type":45,"value":356},{"type":40,"tag":139,"props":19187,"children":19188},{"style":320},[19189],{"type":45,"value":952},{"type":40,"tag":139,"props":19191,"children":19192},{"style":254},[19193],{"type":45,"value":327},{"type":40,"tag":139,"props":19195,"children":19196},{"style":248},[19197],{"type":45,"value":281},{"type":40,"tag":139,"props":19199,"children":19200},{"style":162},[19201],{"type":45,"value":19202},"Final answer:",{"type":40,"tag":139,"props":19204,"children":19205},{"style":248},[19206],{"type":45,"value":281},{"type":40,"tag":139,"props":19208,"children":19209},{"style":248},[19210],{"type":45,"value":974},{"type":40,"tag":139,"props":19212,"children":19213},{"style":254},[19214],{"type":45,"value":19215}," answer)",{"type":40,"tag":139,"props":19217,"children":19218},{"style":248},[19219],{"type":45,"value":286},{"type":40,"tag":117,"props":19221,"children":19222},{},[],{"type":40,"tag":121,"props":19224,"children":19226},{"id":19225},"best-practices",[19227],{"type":45,"value":19228},"Best Practices",{"type":40,"tag":403,"props":19230,"children":19232},{"id":19231},"_1-prefer-callmodel-over-direct-api-calls",[19233],{"type":45,"value":19234},"1. Prefer callModel Over Direct API Calls",{"type":40,"tag":48,"props":19236,"children":19237},{},[19238,19239,19244],{"type":45,"value":4065},{"type":40,"tag":54,"props":19240,"children":19242},{"className":19241},[],[19243],{"type":45,"value":59},{"type":45,"value":19245}," pattern provides automatic tool execution, type safety, and multi-turn handling.",{"type":40,"tag":403,"props":19247,"children":19249},{"id":19248},"_2-use-zod-for-tool-schemas",[19250],{"type":45,"value":19251},"2. Use Zod for Tool Schemas",{"type":40,"tag":48,"props":19253,"children":19254},{},[19255],{"type":45,"value":19256},"Zod provides runtime validation and excellent TypeScript inference:",{"type":40,"tag":128,"props":19258,"children":19260},{"className":231,"code":19259,"language":19,"meta":133,"style":133},"import { z } from 'zod';\n\nconst schema = z.object({\n  name: z.string().min(1),\n  age: z.number().int().positive()\n});\n",[19261],{"type":40,"tag":54,"props":19262,"children":19263},{"__ignoreMap":133},[19264,19303,19310,19346,19399,19453],{"type":40,"tag":139,"props":19265,"children":19266},{"class":141,"line":142},[19267,19271,19275,19279,19283,19287,19291,19295,19299],{"type":40,"tag":139,"props":19268,"children":19269},{"style":242},[19270],{"type":45,"value":245},{"type":40,"tag":139,"props":19272,"children":19273},{"style":248},[19274],{"type":45,"value":251},{"type":40,"tag":139,"props":19276,"children":19277},{"style":254},[19278],{"type":45,"value":6072},{"type":40,"tag":139,"props":19280,"children":19281},{"style":248},[19282],{"type":45,"value":262},{"type":40,"tag":139,"props":19284,"children":19285},{"style":242},[19286],{"type":45,"value":267},{"type":40,"tag":139,"props":19288,"children":19289},{"style":248},[19290],{"type":45,"value":272},{"type":40,"tag":139,"props":19292,"children":19293},{"style":162},[19294],{"type":45,"value":6089},{"type":40,"tag":139,"props":19296,"children":19297},{"style":248},[19298],{"type":45,"value":281},{"type":40,"tag":139,"props":19300,"children":19301},{"style":248},[19302],{"type":45,"value":286},{"type":40,"tag":139,"props":19304,"children":19305},{"class":141,"line":152},[19306],{"type":40,"tag":139,"props":19307,"children":19308},{"emptyLinePlaceholder":177},[19309],{"type":45,"value":180},{"type":40,"tag":139,"props":19311,"children":19312},{"class":141,"line":173},[19313,19317,19322,19326,19330,19334,19338,19342],{"type":40,"tag":139,"props":19314,"children":19315},{"style":299},[19316],{"type":45,"value":302},{"type":40,"tag":139,"props":19318,"children":19319},{"style":254},[19320],{"type":45,"value":19321}," schema ",{"type":40,"tag":139,"props":19323,"children":19324},{"style":248},[19325],{"type":45,"value":312},{"type":40,"tag":139,"props":19327,"children":19328},{"style":254},[19329],{"type":45,"value":6072},{"type":40,"tag":139,"props":19331,"children":19332},{"style":248},[19333],{"type":45,"value":356},{"type":40,"tag":139,"props":19335,"children":19336},{"style":320},[19337],{"type":45,"value":6214},{"type":40,"tag":139,"props":19339,"children":19340},{"style":254},[19341],{"type":45,"value":327},{"type":40,"tag":139,"props":19343,"children":19344},{"style":248},[19345],{"type":45,"value":332},{"type":40,"tag":139,"props":19347,"children":19348},{"class":141,"line":183},[19349,19353,19357,19361,19365,19369,19373,19377,19382,19386,19391,19395],{"type":40,"tag":139,"props":19350,"children":19351},{"style":338},[19352],{"type":45,"value":1193},{"type":40,"tag":139,"props":19354,"children":19355},{"style":248},[19356],{"type":45,"value":346},{"type":40,"tag":139,"props":19358,"children":19359},{"style":254},[19360],{"type":45,"value":6072},{"type":40,"tag":139,"props":19362,"children":19363},{"style":248},[19364],{"type":45,"value":356},{"type":40,"tag":139,"props":19366,"children":19367},{"style":320},[19368],{"type":45,"value":1858},{"type":40,"tag":139,"props":19370,"children":19371},{"style":254},[19372],{"type":45,"value":931},{"type":40,"tag":139,"props":19374,"children":19375},{"style":248},[19376],{"type":45,"value":356},{"type":40,"tag":139,"props":19378,"children":19379},{"style":320},[19380],{"type":45,"value":19381},"min",{"type":40,"tag":139,"props":19383,"children":19384},{"style":254},[19385],{"type":45,"value":327},{"type":40,"tag":139,"props":19387,"children":19388},{"style":3075},[19389],{"type":45,"value":19390},"1",{"type":40,"tag":139,"props":19392,"children":19393},{"style":254},[19394],{"type":45,"value":383},{"type":40,"tag":139,"props":19396,"children":19397},{"style":248},[19398],{"type":45,"value":701},{"type":40,"tag":139,"props":19400,"children":19401},{"class":141,"line":192},[19402,19407,19411,19415,19419,19423,19427,19431,19436,19440,19444,19449],{"type":40,"tag":139,"props":19403,"children":19404},{"style":338},[19405],{"type":45,"value":19406},"  age",{"type":40,"tag":139,"props":19408,"children":19409},{"style":248},[19410],{"type":45,"value":346},{"type":40,"tag":139,"props":19412,"children":19413},{"style":254},[19414],{"type":45,"value":6072},{"type":40,"tag":139,"props":19416,"children":19417},{"style":248},[19418],{"type":45,"value":356},{"type":40,"tag":139,"props":19420,"children":19421},{"style":320},[19422],{"type":45,"value":6464},{"type":40,"tag":139,"props":19424,"children":19425},{"style":254},[19426],{"type":45,"value":931},{"type":40,"tag":139,"props":19428,"children":19429},{"style":248},[19430],{"type":45,"value":356},{"type":40,"tag":139,"props":19432,"children":19433},{"style":320},[19434],{"type":45,"value":19435},"int",{"type":40,"tag":139,"props":19437,"children":19438},{"style":254},[19439],{"type":45,"value":931},{"type":40,"tag":139,"props":19441,"children":19442},{"style":248},[19443],{"type":45,"value":356},{"type":40,"tag":139,"props":19445,"children":19446},{"style":320},[19447],{"type":45,"value":19448},"positive",{"type":40,"tag":139,"props":19450,"children":19451},{"style":254},[19452],{"type":45,"value":6533},{"type":40,"tag":139,"props":19454,"children":19455},{"class":141,"line":995},[19456,19460,19464],{"type":40,"tag":139,"props":19457,"children":19458},{"style":248},[19459],{"type":45,"value":378},{"type":40,"tag":139,"props":19461,"children":19462},{"style":254},[19463],{"type":45,"value":383},{"type":40,"tag":139,"props":19465,"children":19466},{"style":248},[19467],{"type":45,"value":286},{"type":40,"tag":403,"props":19469,"children":19471},{"id":19470},"_3-implement-stop-conditions",[19472],{"type":45,"value":19473},"3. Implement Stop Conditions",{"type":40,"tag":48,"props":19475,"children":19476},{},[19477],{"type":45,"value":19478},"Always set reasonable limits to prevent runaway costs:",{"type":40,"tag":128,"props":19480,"children":19482},{"className":231,"code":19481,"language":19,"meta":133,"style":133},"stopWhen: [stepCountIs(20), maxCost(5.00)]\n",[19483],{"type":40,"tag":54,"props":19484,"children":19485},{"__ignoreMap":133},[19486],{"type":40,"tag":139,"props":19487,"children":19488},{"class":141,"line":142},[19489,19494,19498,19502,19507,19511,19516,19520,19524,19528,19532,19537],{"type":40,"tag":139,"props":19490,"children":19491},{"style":156},[19492],{"type":45,"value":19493},"stopWhen",{"type":40,"tag":139,"props":19495,"children":19496},{"style":248},[19497],{"type":45,"value":346},{"type":40,"tag":139,"props":19499,"children":19500},{"style":254},[19501],{"type":45,"value":7746},{"type":40,"tag":139,"props":19503,"children":19504},{"style":320},[19505],{"type":45,"value":19506},"stepCountIs",{"type":40,"tag":139,"props":19508,"children":19509},{"style":254},[19510],{"type":45,"value":327},{"type":40,"tag":139,"props":19512,"children":19513},{"style":3075},[19514],{"type":45,"value":19515},"20",{"type":40,"tag":139,"props":19517,"children":19518},{"style":254},[19519],{"type":45,"value":383},{"type":40,"tag":139,"props":19521,"children":19522},{"style":248},[19523],{"type":45,"value":974},{"type":40,"tag":139,"props":19525,"children":19526},{"style":320},[19527],{"type":45,"value":8062},{"type":40,"tag":139,"props":19529,"children":19530},{"style":254},[19531],{"type":45,"value":327},{"type":40,"tag":139,"props":19533,"children":19534},{"style":3075},[19535],{"type":45,"value":19536},"5.00",{"type":40,"tag":139,"props":19538,"children":19539},{"style":254},[19540],{"type":45,"value":19541},")]\n",{"type":40,"tag":403,"props":19543,"children":19545},{"id":19544},"_4-handle-errors-gracefully",[19546],{"type":45,"value":19547},"4. Handle Errors Gracefully",{"type":40,"tag":48,"props":19549,"children":19550},{},[19551],{"type":45,"value":19552},"Implement retry logic for transient failures:",{"type":40,"tag":128,"props":19554,"children":19556},{"className":231,"code":19555,"language":19,"meta":133,"style":133},"async function callWithRetry(params, maxRetries = 3) {\n  for (let i = 0; i \u003C maxRetries; i++) {\n    try {\n      return await client.callModel(params).getText();\n    } catch (error) {\n      if (error.statusCode === 429 || error.statusCode >= 500) {\n        await sleep(Math.pow(2, i) * 1000);\n        continue;\n      }\n      throw error;\n    }\n  }\n}\n",[19557],{"type":40,"tag":54,"props":19558,"children":19559},{"__ignoreMap":133},[19560,19609,19677,19689,19740,19767,19834,19902,19914,19921,19937,19944,19951],{"type":40,"tag":139,"props":19561,"children":19562},{"class":141,"line":142},[19563,19567,19571,19576,19580,19584,19588,19593,19597,19601,19605],{"type":40,"tag":139,"props":19564,"children":19565},{"style":299},[19566],{"type":45,"value":10020},{"type":40,"tag":139,"props":19568,"children":19569},{"style":299},[19570],{"type":45,"value":7579},{"type":40,"tag":139,"props":19572,"children":19573},{"style":320},[19574],{"type":45,"value":19575}," callWithRetry",{"type":40,"tag":139,"props":19577,"children":19578},{"style":248},[19579],{"type":45,"value":327},{"type":40,"tag":139,"props":19581,"children":19582},{"style":2640},[19583],{"type":45,"value":6573},{"type":40,"tag":139,"props":19585,"children":19586},{"style":248},[19587],{"type":45,"value":974},{"type":40,"tag":139,"props":19589,"children":19590},{"style":2640},[19591],{"type":45,"value":19592}," maxRetries",{"type":40,"tag":139,"props":19594,"children":19595},{"style":248},[19596],{"type":45,"value":2682},{"type":40,"tag":139,"props":19598,"children":19599},{"style":3075},[19600],{"type":45,"value":8791},{"type":40,"tag":139,"props":19602,"children":19603},{"style":248},[19604],{"type":45,"value":383},{"type":40,"tag":139,"props":19606,"children":19607},{"style":248},[19608],{"type":45,"value":1436},{"type":40,"tag":139,"props":19610,"children":19611},{"class":141,"line":152},[19612,19616,19620,19625,19630,19634,19639,19643,19647,19652,19656,19660,19664,19669,19673],{"type":40,"tag":139,"props":19613,"children":19614},{"style":242},[19615],{"type":45,"value":10041},{"type":40,"tag":139,"props":19617,"children":19618},{"style":338},[19619],{"type":45,"value":2637},{"type":40,"tag":139,"props":19621,"children":19622},{"style":299},[19623],{"type":45,"value":19624},"let",{"type":40,"tag":139,"props":19626,"children":19627},{"style":254},[19628],{"type":45,"value":19629}," i",{"type":40,"tag":139,"props":19631,"children":19632},{"style":248},[19633],{"type":45,"value":2682},{"type":40,"tag":139,"props":19635,"children":19636},{"style":3075},[19637],{"type":45,"value":19638}," 0",{"type":40,"tag":139,"props":19640,"children":19641},{"style":248},[19642],{"type":45,"value":2056},{"type":40,"tag":139,"props":19644,"children":19645},{"style":254},[19646],{"type":45,"value":19629},{"type":40,"tag":139,"props":19648,"children":19649},{"style":248},[19650],{"type":45,"value":19651}," \u003C",{"type":40,"tag":139,"props":19653,"children":19654},{"style":254},[19655],{"type":45,"value":19592},{"type":40,"tag":139,"props":19657,"children":19658},{"style":248},[19659],{"type":45,"value":2056},{"type":40,"tag":139,"props":19661,"children":19662},{"style":254},[19663],{"type":45,"value":19629},{"type":40,"tag":139,"props":19665,"children":19666},{"style":248},[19667],{"type":45,"value":19668},"++",{"type":40,"tag":139,"props":19670,"children":19671},{"style":338},[19672],{"type":45,"value":3042},{"type":40,"tag":139,"props":19674,"children":19675},{"style":248},[19676],{"type":45,"value":332},{"type":40,"tag":139,"props":19678,"children":19679},{"class":141,"line":173},[19680,19685],{"type":40,"tag":139,"props":19681,"children":19682},{"style":242},[19683],{"type":45,"value":19684},"    try",{"type":40,"tag":139,"props":19686,"children":19687},{"style":248},[19688],{"type":45,"value":1436},{"type":40,"tag":139,"props":19690,"children":19691},{"class":141,"line":183},[19692,19696,19700,19704,19708,19712,19716,19720,19724,19728,19732,19736],{"type":40,"tag":139,"props":19693,"children":19694},{"style":242},[19695],{"type":45,"value":9372},{"type":40,"tag":139,"props":19697,"children":19698},{"style":242},[19699],{"type":45,"value":903},{"type":40,"tag":139,"props":19701,"children":19702},{"style":254},[19703],{"type":45,"value":655},{"type":40,"tag":139,"props":19705,"children":19706},{"style":248},[19707],{"type":45,"value":356},{"type":40,"tag":139,"props":19709,"children":19710},{"style":320},[19711],{"type":45,"value":59},{"type":40,"tag":139,"props":19713,"children":19714},{"style":338},[19715],{"type":45,"value":327},{"type":40,"tag":139,"props":19717,"children":19718},{"style":254},[19719],{"type":45,"value":6573},{"type":40,"tag":139,"props":19721,"children":19722},{"style":338},[19723],{"type":45,"value":383},{"type":40,"tag":139,"props":19725,"children":19726},{"style":248},[19727],{"type":45,"value":356},{"type":40,"tag":139,"props":19729,"children":19730},{"style":320},[19731],{"type":45,"value":3908},{"type":40,"tag":139,"props":19733,"children":19734},{"style":338},[19735],{"type":45,"value":931},{"type":40,"tag":139,"props":19737,"children":19738},{"style":248},[19739],{"type":45,"value":286},{"type":40,"tag":139,"props":19741,"children":19742},{"class":141,"line":192},[19743,19747,19751,19755,19759,19763],{"type":40,"tag":139,"props":19744,"children":19745},{"style":248},[19746],{"type":45,"value":3229},{"type":40,"tag":139,"props":19748,"children":19749},{"style":242},[19750],{"type":45,"value":3379},{"type":40,"tag":139,"props":19752,"children":19753},{"style":338},[19754],{"type":45,"value":2637},{"type":40,"tag":139,"props":19756,"children":19757},{"style":254},[19758],{"type":45,"value":3388},{"type":40,"tag":139,"props":19760,"children":19761},{"style":338},[19762],{"type":45,"value":3042},{"type":40,"tag":139,"props":19764,"children":19765},{"style":248},[19766],{"type":45,"value":332},{"type":40,"tag":139,"props":19768,"children":19769},{"class":141,"line":995},[19770,19775,19779,19783,19787,19791,19795,19799,19804,19808,19812,19816,19821,19826,19830],{"type":40,"tag":139,"props":19771,"children":19772},{"style":242},[19773],{"type":45,"value":19774},"      if",{"type":40,"tag":139,"props":19776,"children":19777},{"style":338},[19778],{"type":45,"value":2637},{"type":40,"tag":139,"props":19780,"children":19781},{"style":254},[19782],{"type":45,"value":3388},{"type":40,"tag":139,"props":19784,"children":19785},{"style":248},[19786],{"type":45,"value":356},{"type":40,"tag":139,"props":19788,"children":19789},{"style":254},[19790],{"type":45,"value":16951},{"type":40,"tag":139,"props":19792,"children":19793},{"style":248},[19794],{"type":45,"value":15803},{"type":40,"tag":139,"props":19796,"children":19797},{"style":3075},[19798],{"type":45,"value":17136},{"type":40,"tag":139,"props":19800,"children":19801},{"style":248},[19802],{"type":45,"value":19803}," ||",{"type":40,"tag":139,"props":19805,"children":19806},{"style":254},[19807],{"type":45,"value":3439},{"type":40,"tag":139,"props":19809,"children":19810},{"style":248},[19811],{"type":45,"value":356},{"type":40,"tag":139,"props":19813,"children":19814},{"style":254},[19815],{"type":45,"value":16951},{"type":40,"tag":139,"props":19817,"children":19818},{"style":248},[19819],{"type":45,"value":19820}," >=",{"type":40,"tag":139,"props":19822,"children":19823},{"style":3075},[19824],{"type":45,"value":19825}," 500",{"type":40,"tag":139,"props":19827,"children":19828},{"style":338},[19829],{"type":45,"value":3042},{"type":40,"tag":139,"props":19831,"children":19832},{"style":248},[19833],{"type":45,"value":332},{"type":40,"tag":139,"props":19835,"children":19836},{"class":141,"line":1213},[19837,19842,19847,19851,19856,19860,19865,19869,19874,19878,19882,19886,19890,19894,19898],{"type":40,"tag":139,"props":19838,"children":19839},{"style":242},[19840],{"type":45,"value":19841},"        await",{"type":40,"tag":139,"props":19843,"children":19844},{"style":320},[19845],{"type":45,"value":19846}," sleep",{"type":40,"tag":139,"props":19848,"children":19849},{"style":338},[19850],{"type":45,"value":327},{"type":40,"tag":139,"props":19852,"children":19853},{"style":254},[19854],{"type":45,"value":19855},"Math",{"type":40,"tag":139,"props":19857,"children":19858},{"style":248},[19859],{"type":45,"value":356},{"type":40,"tag":139,"props":19861,"children":19862},{"style":320},[19863],{"type":45,"value":19864},"pow",{"type":40,"tag":139,"props":19866,"children":19867},{"style":338},[19868],{"type":45,"value":327},{"type":40,"tag":139,"props":19870,"children":19871},{"style":3075},[19872],{"type":45,"value":19873},"2",{"type":40,"tag":139,"props":19875,"children":19876},{"style":248},[19877],{"type":45,"value":974},{"type":40,"tag":139,"props":19879,"children":19880},{"style":254},[19881],{"type":45,"value":19629},{"type":40,"tag":139,"props":19883,"children":19884},{"style":338},[19885],{"type":45,"value":3042},{"type":40,"tag":139,"props":19887,"children":19888},{"style":248},[19889],{"type":45,"value":7584},{"type":40,"tag":139,"props":19891,"children":19892},{"style":3075},[19893],{"type":45,"value":9719},{"type":40,"tag":139,"props":19895,"children":19896},{"style":338},[19897],{"type":45,"value":383},{"type":40,"tag":139,"props":19899,"children":19900},{"style":248},[19901],{"type":45,"value":286},{"type":40,"tag":139,"props":19903,"children":19904},{"class":141,"line":1229},[19905,19910],{"type":40,"tag":139,"props":19906,"children":19907},{"style":242},[19908],{"type":45,"value":19909},"        continue",{"type":40,"tag":139,"props":19911,"children":19912},{"style":248},[19913],{"type":45,"value":286},{"type":40,"tag":139,"props":19915,"children":19916},{"class":141,"line":1237},[19917],{"type":40,"tag":139,"props":19918,"children":19919},{"style":248},[19920],{"type":45,"value":11940},{"type":40,"tag":139,"props":19922,"children":19923},{"class":141,"line":1246},[19924,19929,19933],{"type":40,"tag":139,"props":19925,"children":19926},{"style":242},[19927],{"type":45,"value":19928},"      throw",{"type":40,"tag":139,"props":19930,"children":19931},{"style":254},[19932],{"type":45,"value":3439},{"type":40,"tag":139,"props":19934,"children":19935},{"style":248},[19936],{"type":45,"value":286},{"type":40,"tag":139,"props":19938,"children":19939},{"class":141,"line":1296},[19940],{"type":40,"tag":139,"props":19941,"children":19942},{"style":248},[19943],{"type":45,"value":5017},{"type":40,"tag":139,"props":19945,"children":19946},{"class":141,"line":1322},[19947],{"type":40,"tag":139,"props":19948,"children":19949},{"style":248},[19950],{"type":45,"value":1471},{"type":40,"tag":139,"props":19952,"children":19953},{"class":141,"line":1338},[19954],{"type":40,"tag":139,"props":19955,"children":19956},{"style":248},[19957],{"type":45,"value":5988},{"type":40,"tag":403,"props":19959,"children":19961},{"id":19960},"_5-use-streaming-for-long-responses",[19962],{"type":45,"value":19963},"5. Use Streaming for Long Responses",{"type":40,"tag":48,"props":19965,"children":19966},{},[19967],{"type":45,"value":19968},"Streaming provides better UX and allows early termination:",{"type":40,"tag":128,"props":19970,"children":19972},{"className":231,"code":19971,"language":19,"meta":133,"style":133},"for await (const delta of result.getTextStream()) {\n  \u002F\u002F Process incrementally\n}\n",[19973],{"type":40,"tag":54,"props":19974,"children":19975},{"__ignoreMap":133},[19976,20023,20031],{"type":40,"tag":139,"props":19977,"children":19978},{"class":141,"line":142},[19979,19983,19987,19991,19995,19999,20003,20007,20011,20015,20019],{"type":40,"tag":139,"props":19980,"children":19981},{"style":242},[19982],{"type":45,"value":5893},{"type":40,"tag":139,"props":19984,"children":19985},{"style":242},[19986],{"type":45,"value":903},{"type":40,"tag":139,"props":19988,"children":19989},{"style":254},[19990],{"type":45,"value":2637},{"type":40,"tag":139,"props":19992,"children":19993},{"style":299},[19994],{"type":45,"value":302},{"type":40,"tag":139,"props":19996,"children":19997},{"style":254},[19998],{"type":45,"value":5910},{"type":40,"tag":139,"props":20000,"children":20001},{"style":248},[20002],{"type":45,"value":5915},{"type":40,"tag":139,"props":20004,"children":20005},{"style":254},[20006],{"type":45,"value":3762},{"type":40,"tag":139,"props":20008,"children":20009},{"style":248},[20010],{"type":45,"value":356},{"type":40,"tag":139,"props":20012,"children":20013},{"style":320},[20014],{"type":45,"value":5928},{"type":40,"tag":139,"props":20016,"children":20017},{"style":254},[20018],{"type":45,"value":5933},{"type":40,"tag":139,"props":20020,"children":20021},{"style":248},[20022],{"type":45,"value":332},{"type":40,"tag":139,"props":20024,"children":20025},{"class":141,"line":152},[20026],{"type":40,"tag":139,"props":20027,"children":20028},{"style":146},[20029],{"type":45,"value":20030},"  \u002F\u002F Process incrementally\n",{"type":40,"tag":139,"props":20032,"children":20033},{"class":141,"line":173},[20034],{"type":40,"tag":139,"props":20035,"children":20036},{"style":248},[20037],{"type":45,"value":5988},{"type":40,"tag":117,"props":20039,"children":20040},{},[],{"type":40,"tag":121,"props":20042,"children":20044},{"id":20043},"additional-resources",[20045],{"type":45,"value":20046},"Additional Resources",{"type":40,"tag":68,"props":20048,"children":20049},{},[20050,20065,20081,20097],{"type":40,"tag":72,"props":20051,"children":20052},{},[20053,20058,20060],{"type":40,"tag":76,"props":20054,"children":20055},{},[20056],{"type":45,"value":20057},"API Keys",{"type":45,"value":20059},": ",{"type":40,"tag":219,"props":20061,"children":20063},{"href":221,"rel":20062},[223],[20064],{"type":45,"value":226},{"type":40,"tag":72,"props":20066,"children":20067},{},[20068,20073,20074],{"type":40,"tag":76,"props":20069,"children":20070},{},[20071],{"type":45,"value":20072},"Model List",{"type":45,"value":20059},{"type":40,"tag":219,"props":20075,"children":20078},{"href":20076,"rel":20077},"https:\u002F\u002Fopenrouter.ai\u002Fmodels",[223],[20079],{"type":45,"value":20080},"openrouter.ai\u002Fmodels",{"type":40,"tag":72,"props":20082,"children":20083},{},[20084,20089,20090],{"type":40,"tag":76,"props":20085,"children":20086},{},[20087],{"type":45,"value":20088},"Agent SDK",{"type":45,"value":20059},{"type":40,"tag":219,"props":20091,"children":20094},{"href":20092,"rel":20093},"https:\u002F\u002Fgithub.com\u002FOpenRouterTeam\u002Ftypescript-agent",[223],[20095],{"type":45,"value":20096},"github.com\u002FOpenRouterTeam\u002Ftypescript-agent",{"type":40,"tag":72,"props":20098,"children":20099},{},[20100,20105,20106],{"type":40,"tag":76,"props":20101,"children":20102},{},[20103],{"type":45,"value":20104},"SDK Issues",{"type":45,"value":20059},{"type":40,"tag":219,"props":20107,"children":20110},{"href":20108,"rel":20109},"https:\u002F\u002Fgithub.com\u002FOpenRouterTeam\u002Ftypescript-sdk\u002Fissues",[223],[20111],{"type":45,"value":20112},"github.com\u002FOpenRouterTeam\u002Ftypescript-sdk\u002Fissues",{"type":40,"tag":117,"props":20114,"children":20115},{},[],{"type":40,"tag":48,"props":20117,"children":20118},{},[20119],{"type":40,"tag":20120,"props":20121,"children":20122},"em",{},[20123],{"type":45,"value":20124},"SDK Status: Beta - Report issues on GitHub",{"type":40,"tag":20126,"props":20127,"children":20128},"style",{},[20129],{"type":45,"value":20130},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":20132,"total":1421},[20133,20148,20158,20172,20184,20194,20203,20215,20227,20236,20247,20256],{"slug":20134,"name":20134,"fn":20135,"description":20136,"org":20137,"tags":20138,"stars":23,"repoUrl":24,"updatedAt":20147},"create-agent-tui","scaffold terminal agents with OpenRouter","Scaffolds a complete agent TUI in TypeScript using @openrouter\u002Fagent — like create-react-app for terminal agents. Generates a customizable terminal interface with three input styles, four tool display modes, ASCII banners, streaming output, session persistence, and configurable tools. Use when building an agent, creating a TUI, scaffolding an agent project, or building a coding assistant.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20139,20142,20145,20146],{"name":20140,"slug":20141,"type":16},"Agents","agents",{"name":20143,"slug":20144,"type":16},"CLI","cli",{"name":9,"slug":8,"type":16},{"name":18,"slug":19,"type":16},"2026-07-14T05:38:18.849741",{"slug":20149,"name":20149,"fn":20150,"description":20151,"org":20152,"tags":20153,"stars":23,"repoUrl":24,"updatedAt":20157},"create-headless-agent","scaffold headless agents with OpenRouter","Scaffolds a headless agent in TypeScript using @openrouter\u002Fagent and Bun — for CLI tools, API servers, queue workers, and pipelines. No terminal UI. Use when building a headless agent, programmatic agent, CLI tool that uses AI, batch agent, pipeline agent, API agent, agent without a UI, or agent service.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20154,20155,20156],{"name":20140,"slug":20141,"type":16},{"name":20143,"slug":20144,"type":16},{"name":18,"slug":19,"type":16},"2026-07-14T05:38:30.178029",{"slug":20159,"name":20159,"fn":20160,"description":20161,"org":20162,"tags":20163,"stars":23,"repoUrl":24,"updatedAt":20171},"open-responses","implement Open Responses-compliant APIs","This skill should be used when implementing, consuming, or debugging an Open Responses-compliant API — the open standard for multi-provider LLM interoperability. Covers protocol, items, state machines, streaming events, tools, the agentic loop pattern, and extensions. Triggers on: Open Responses, open-responses, \u002Fv1\u002Fresponses endpoint, multi-provider LLM API, Open Responses compliance.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20164,20167,20170],{"name":20165,"slug":20166,"type":16},"API Development","api-development",{"name":20168,"slug":20169,"type":16},"Interoperability","interoperability",{"name":14,"slug":15,"type":16},"2026-07-14T05:38:13.153467",{"slug":20173,"name":20173,"fn":20174,"description":20175,"org":20176,"tags":20177,"stars":23,"repoUrl":24,"updatedAt":20183},"openrouter-agent-migration","migrate OpenRouter SDK to agent patterns","Migration guide from @openrouter\u002Fsdk to @openrouter\u002Fagent for callModel, tool(), stop conditions, and agent features. This skill should be used when code imports callModel, tool(), or stop conditions from @openrouter\u002Fsdk and needs to migrate to @openrouter\u002Fagent.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20178,20181,20182],{"name":20179,"slug":20180,"type":16},"Migration","migration",{"name":21,"slug":22,"type":16},{"name":18,"slug":19,"type":16},"2026-07-14T05:38:28.914981",{"slug":20185,"name":20185,"fn":20186,"description":20187,"org":20188,"tags":20189,"stars":23,"repoUrl":24,"updatedAt":20193},"openrouter-analytics","analyze OpenRouter usage and spend","Answer natural-language questions about a user's OpenRouter usage data — spend, request volume, model breakdown, latency, token usage, and cost optimization. Use when the user asks about their API usage, billing, costs, top models, traffic patterns, or wants to optimize their OpenRouter spend.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20190,20192],{"name":20191,"slug":16587,"type":16},"Analytics",{"name":9,"slug":8,"type":16},"2026-07-30T05:30:15.098344",{"slug":20195,"name":20195,"fn":20196,"description":20197,"org":20198,"tags":20199,"stars":23,"repoUrl":24,"updatedAt":20202},"openrouter-analytics-query","execute analytics queries against OpenRouter","Construct and execute analytics queries against the OpenRouter API — full parameter reference for metrics, dimensions, filters, time ranges, ordering, and pagination. Use when building or debugging an analytics query, understanding the request\u002Fresponse shape, or handling query errors.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20200,20201],{"name":20191,"slug":16587,"type":16},{"name":20165,"slug":20166,"type":16},"2026-07-14T05:38:26.402047",{"slug":20204,"name":20204,"fn":20205,"description":20206,"org":20207,"tags":20208,"stars":23,"repoUrl":24,"updatedAt":20214},"openrouter-analytics-schema","query OpenRouter analytics schema","Discover the OpenRouter analytics schema — available metrics, dimensions, filter operators, and granularities. Use when you need to know what analytics data is queryable, what dimensions you can break down by, or how to map a user's question to the right metric\u002Fdimension combination.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20209,20210,20211],{"name":20191,"slug":16587,"type":16},{"name":14,"slug":15,"type":16},{"name":20212,"slug":20213,"type":16},"Reporting","reporting","2026-07-14T05:38:32.721796",{"slug":20216,"name":20216,"fn":20217,"description":20218,"org":20219,"tags":20220,"stars":23,"repoUrl":24,"updatedAt":20226},"openrouter-benchmarks","query OpenRouter model benchmarks","Query OpenRouter's Benchmarks API for model benchmark rankings and scores. Use when the user asks for benchmark-backed model selection, model rankings by coding\u002Fintelligence\u002Fagentic ability, Artificial Analysis or Design Arena ELO\u002Fwin-rate results, benchmark citations, or wants to call GET \u002Fapi\u002Fv1\u002Fbenchmarks. Also use alongside openrouter-models when the user asks what model should power an app, product, workflow, or use case and benchmark evidence could inform or rule out part of the recommendation, including creative writing, editing, coding, design, agentic, or intelligence-heavy apps. Do not use for OpenRouter usage analytics, billing\u002Fspend analysis, generation metadata, provider uptime\u002Flatency, generic model pricing\u002Fcapability lookup without any selection or benchmark-relevance decision, or creating an evaluation suite for a local app.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20221,20222,20225],{"name":20191,"slug":16587,"type":16},{"name":20223,"slug":20224,"type":16},"Benchmarking","benchmarking",{"name":14,"slug":15,"type":16},"2026-07-14T05:38:27.658475",{"slug":20228,"name":20228,"fn":20229,"description":20230,"org":20231,"tags":20232,"stars":23,"repoUrl":24,"updatedAt":20235},"openrouter-generations","retrieve metadata for OpenRouter generations","Retrieve detailed metadata and stored content for individual OpenRouter generations. Use when the user wants to inspect a specific request — its cost, latency, token usage, provider routing, or the actual prompt\u002Fcompletion text — or is debugging a failed or unexpected generation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20233,20234],{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},"2026-07-14T05:38:25.132801",{"slug":20237,"name":20237,"fn":20238,"description":20239,"org":20240,"tags":20241,"stars":23,"repoUrl":24,"updatedAt":20246},"openrouter-images","generate images with OpenRouter","Generate images from text prompts and edit existing images using OpenRouter's dedicated Image API. Use when the user asks to create, generate, or make an image, picture, or illustration from a description, or wants to edit, modify, transform, or alter an existing image with a text prompt.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20242,20245],{"name":20243,"slug":20244,"type":16},"Image Generation","image-generation",{"name":9,"slug":8,"type":16},"2026-07-14T05:38:21.393411",{"slug":20248,"name":20248,"fn":20249,"description":20250,"org":20251,"tags":20252,"stars":23,"repoUrl":24,"updatedAt":20255},"openrouter-models","query OpenRouter model metadata and pricing","Query OpenRouter for available AI models, pricing, capabilities, throughput, and provider performance. Use when the user asks about available OpenRouter models, model pricing, model context lengths, model capabilities, provider latency or uptime, throughput limits, supported parameters, wants to search\u002Ffilter\u002Fcompare models, or find the fastest provider for a model.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20253,20254],{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},"2026-07-14T05:38:22.650307",{"slug":20257,"name":20257,"fn":20258,"description":20259,"org":20260,"tags":20261,"stars":23,"repoUrl":24,"updatedAt":20269},"openrouter-oauth","implement OpenRouter OAuth authentication","Implement \"Sign In with OpenRouter\" using OAuth PKCE — framework-agnostic, no SDK or client registration required. Use when the user wants to add OpenRouter login, authentication, sign-in buttons, OAuth, or AI model inference API keys for browser-based apps. No client registration, no backend, no secrets required.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20262,20265,20268],{"name":20263,"slug":20264,"type":16},"Auth","auth",{"name":20266,"slug":20267,"type":16},"OAuth","oauth",{"name":9,"slug":8,"type":16},"2026-07-14T05:38:20.116308",{"items":20271,"total":1421},[20272,20279,20285,20291,20297,20302,20307],{"slug":20134,"name":20134,"fn":20135,"description":20136,"org":20273,"tags":20274,"stars":23,"repoUrl":24,"updatedAt":20147},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20275,20276,20277,20278],{"name":20140,"slug":20141,"type":16},{"name":20143,"slug":20144,"type":16},{"name":9,"slug":8,"type":16},{"name":18,"slug":19,"type":16},{"slug":20149,"name":20149,"fn":20150,"description":20151,"org":20280,"tags":20281,"stars":23,"repoUrl":24,"updatedAt":20157},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20282,20283,20284],{"name":20140,"slug":20141,"type":16},{"name":20143,"slug":20144,"type":16},{"name":18,"slug":19,"type":16},{"slug":20159,"name":20159,"fn":20160,"description":20161,"org":20286,"tags":20287,"stars":23,"repoUrl":24,"updatedAt":20171},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20288,20289,20290],{"name":20165,"slug":20166,"type":16},{"name":20168,"slug":20169,"type":16},{"name":14,"slug":15,"type":16},{"slug":20173,"name":20173,"fn":20174,"description":20175,"org":20292,"tags":20293,"stars":23,"repoUrl":24,"updatedAt":20183},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20294,20295,20296],{"name":20179,"slug":20180,"type":16},{"name":21,"slug":22,"type":16},{"name":18,"slug":19,"type":16},{"slug":20185,"name":20185,"fn":20186,"description":20187,"org":20298,"tags":20299,"stars":23,"repoUrl":24,"updatedAt":20193},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20300,20301],{"name":20191,"slug":16587,"type":16},{"name":9,"slug":8,"type":16},{"slug":20195,"name":20195,"fn":20196,"description":20197,"org":20303,"tags":20304,"stars":23,"repoUrl":24,"updatedAt":20202},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20305,20306],{"name":20191,"slug":16587,"type":16},{"name":20165,"slug":20166,"type":16},{"slug":20204,"name":20204,"fn":20205,"description":20206,"org":20308,"tags":20309,"stars":23,"repoUrl":24,"updatedAt":20214},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[20310,20311,20312],{"name":20191,"slug":16587,"type":16},{"name":14,"slug":15,"type":16},{"name":20212,"slug":20213,"type":16}]