Tikway / Guides

AI API and Agent integration guides

Learn Tikway API integration with Python, Node.js, OpenAI SDK, Claude, Gemini, Claude Code, Cherry Studio and Agent frameworks, plus token costs and troubleshooting.

All 15 guides are available in English and Chinese, covering SDKs, protocols, clients, Agents, model selection and troubleshooting. Code and API fields retain their original names.

Python · OpenAI

Connect Python to Tikway: OpenAI-compatible Chat Completions with the standard library

Use Python urllib to call Tikway Chat Completions, configure an API key and exact model ID, read text and usage, and troubleshoot request errors.

Read guide
Node.js · SSE

Stream Tikway responses in Node.js: fetch, SSE and UTF-8 chunk handling

Stream Tikway text with Node.js fetch. Parse UTF-8 chunks and multiline SSE events, detect errors and completion, and test the parser offline.

Read guide
Claude · Anthropic

Use Claude API through Tikway: the Anthropic Messages protocol

Call Claude through Tikway using Anthropic Messages, x-api-key and a protocol version. Save responses, read text blocks and check stop reasons.

Read guide
Gemini · generateContent

Use Gemini API through Tikway: generateContent and authentication

Configure Tikway Gemini generateContent URLs and x-goog-api-key, read candidate text, add conversation history, and use the streaming action path.

Read guide
Billing · Troubleshooting

Calculate AI API costs: Tikway token billing and error troubleshooting

Calculate text and batch token budgets, reconcile cache usage across OpenAI, Anthropic and Gemini, and distinguish balance, rate limits and streaming errors.

Read guide
SDK · Integration

Connect the OpenAI SDK to Tikway: Python and Node.js configuration

Set Tikway base_url or baseURL in the Python and Node.js OpenAI SDK, send Chat Completions requests, check usage and troubleshoot configuration.

Read guide
Claude Code · Client

Connect Claude Code to Tikway: environment setup and first-request checks

Configure Claude Code with a Tikway Anthropic Base URL, API key and Claude model ID. Verify text, tools and request records before coding tasks.

Read guide
Cherry Studio · Client

Connect Cherry Studio to Tikway: custom API URL, model IDs and troubleshooting

Add Tikway as an OpenAI-compatible Cherry Studio provider, verify the final request URL and model ID, and troubleshoot authentication and streaming.

Read guide
401 · Troubleshooting

Troubleshoot API 401 errors: API keys, authentication headers and URLs

Diagnose AI API 401 errors by checking the actual key, protocol headers, base URL and environment. Separate authentication, permissions and rate limits.

Read guide
SSE · Troubleshooting

Troubleshoot interrupted AI API streams: SSE parsing, timeouts and proxies

Troubleshoot incomplete streams across OpenAI, Anthropic and Gemini. Check termination events, UTF-8 parsing, proxy buffering and client timeouts.

Read guide
Coding · Model selection

Choose models for coding: API prices, context windows and tool calling

Select coding and Agent models by protocol, context, output limits and tool support. Compare task quality and cost using consistent test samples.

Read guide
Models · Verification

Verify Tikway model IDs and billing: request records and evidence limits

Match Tikway model IDs and protocols to request records, token usage and charges. Understand what metadata, tests and model self-descriptions can prove.

Read guide
LangChain · Agent

Connect LangChain to Tikway: ChatOpenAI and an Agent tool loop

Configure LangChain ChatOpenAI with a Tikway Base URL, API Key, and model ID. Inspect a bounded local tool loop, verify its results, and estimate Agent request costs.

Read guide
Dify · Agent

Connect Dify to Tikway: an OpenAI-compatible provider and Agent checks

Configure a Tikway model through Dify's OpenAI-compatible provider, distinguish provider and application Keys, and inspect Chatflow, Agent strategy, and tool execution.

Read guide
n8n · AI Agent

Connect n8n AI Agent to Tikway: OpenAI Chat Model and a tool test

Set a Tikway Key, Base URL, and model ID in n8n OpenAI Chat Model. Disable Responses mode, attach Calculator, and check Agent iterations, results, and costs.

Read guide