Client SDKs

Client SDKs are for server-side applications that call JoyToken directly. They wrap the current public developer APIs (not Console management APIs) and add a bounded, automatic tool-calling loop on top.

Pick a language, install, set two environment variables, and make your first call in under five minutes.

Choose an SDK

LanguagePackageSourceGuide
TypeScript@joytoken/client-sdk-tsclient-sdk-tsTypeScript SDK
Gogithub.com/jd-opensource/joytoken-sdk-gojoytoken-sdk-goGo SDK

Runnable example projects: TypeScript example · Go example.

What you can do

Every capability below links to a complete, copy-and-run example.

CapabilityTypeScriptGoWhere to start
Chat CompletionsSupportedSupportedExamples → Chat
OpenAI ResponsesSupportedSupportedExamples → Responses
Anthropic MessagesSupportedSupportedExamples → Anthropic
Streaming responsesSupportedSupportedExamples → Streaming
Image generationSupportedSupportedAPI Reference
Image editingSupportedSupportedAPI Reference
Model listSupportedSupportedExamples → Model list
Tool-calling loopAutomaticRunChatCompletionTS · Go
Error handlingSupportedSupportedExamples → Errors

Streaming applies to Chat Completions, Responses, and Anthropic Messages. Image generation and editing are non-streaming.

How the tool-calling loop works

The client SDKs run a bounded tool-calling loop over the compatible APIs: when the model returns tool_calls, the SDK executes the matching local tools and feeds their results back automatically, repeating until the model returns a final message or the step limit is reached. The safe, zero-config calculator and datetime tools are injected by default.

See the full tool-calling reference for TypeScript or Go.

Required values

You only ever need two things, plus the protocol-specific base URL.

ItemValue
API keyJOY_TOKEN_API_KEY
API Base URLJOY_TOKEN_API_BASE_URL from Environments
Request modelauto (not configurable)

Base URL: JOY_TOKEN_OPENAI_BASE_URL from Environments.

Next steps

PageUse it for
QuickstartInstall and run your first request in 3 steps
ExamplesCopy full, runnable examples for every capability
TypeScript SDKClient options, tool calling, error types
Go SDKClient options, tool calling, error types