Together AI Chat Completions Skill for Claude Code
Skill that teaches Claude Code how to use Together AI chat completions API. Covers streaming, tool calling, JSON mode, and model selection with correct SDK patterns.
Agent 可直接安装
这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。
npx -y tokrepo@latest install e99e1db6-62ed-4ba1-8749-c64706c0ec1a --target codex先 dry-run 确认安装计划,再运行此命令。
What it is
This is a Claude Code skill that teaches AI coding agents how to correctly call Together AI's chat completions API. It provides the exact SDK patterns, model identifiers, and parameter configurations needed to integrate Together AI into your applications. The skill covers streaming responses, tool calling, JSON mode, and model selection.
The skill targets developers using Claude Code, Cursor, or Codex CLI who need to build applications with Together AI's inference API. Instead of reading API documentation and translating it into code, the agent already knows the correct patterns.
How it saves time or tokens
Without this skill, an AI coding agent guesses at Together AI's API patterns based on its training data, which may be outdated or incorrect. The skill provides verified, current SDK patterns that work on the first try. This eliminates debugging cycles caused by wrong parameter names, deprecated model IDs, or incorrect streaming implementations. The token savings come from avoiding retry prompts and error correction.
How to use
- Install the skill into your Claude Code environment:
npx skills add togethercomputer/skills
# Or copy to ~/.claude/skills/together-chat-completions/
- The skill activates automatically when you ask Claude Code to write Together AI integration code.
- Ask Claude Code to implement Together AI chat completions, and it will use the correct SDK patterns from the skill.
Example
Basic Together AI chat completion with streaming:
import together
client = together.Together(api_key='your-key')
stream = client.chat.completions.create(
model='meta-llama/Llama-3-70b-chat-hf',
messages=[{'role': 'user', 'content': 'Explain transformers briefly'}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end='')
The skill ensures the agent uses the correct model identifier format, streaming iteration pattern, and error handling.
Related on TokRepo
- AI Tools for API — API integration tools and patterns for AI services
- AI Tools for Coding — Coding assistants and skills that enhance developer productivity
Common pitfalls
- Together AI model identifiers use the format 'org/model-name'. Using short names without the organization prefix causes 404 errors.
- Streaming responses require iterating over chunks and checking
delta.contentfor None values. Missing this check causes TypeError exceptions. - The Together AI SDK is a separate package from OpenAI's SDK. Installing
togetherinstead ofopenaiis required even though the API is OpenAI-compatible. - Always check the official documentation for the latest version-specific changes and migration guides before upgrading in production environments.
- For team deployments, establish clear guidelines on configuration and usage patterns to ensure consistency across developers.
常见问题
The skill provides verified SDK patterns for Together AI's chat completions API including model selection, streaming, tool calling, JSON mode, and error handling. It ensures the agent generates correct code on the first attempt.
Yes. You need a Together AI API key to make actual API calls. The skill provides the code patterns, but authentication requires your own account and key.
Yes. The skill is compatible with Claude Code, Cursor, and Codex CLI. Any MCP-compatible AI coding environment can load and use the skill patterns.
Together AI provides access to open-source models including Llama, Mistral, Mixtral, and others. The skill includes current model identifiers so the agent selects valid models rather than hallucinating outdated names.
Yes, Together AI's API follows the OpenAI chat completions format. However, using the dedicated Together Python SDK is recommended as it handles model routing and provider-specific features correctly.
引用来源 (3)
- Together AI Documentation— Together AI chat completions API with streaming and tool calling
- Together AI GitHub— Together AI Python SDK installation and usage
- Anthropic Docs— Claude Code skills system for AI coding agents
来源与感谢
togethercomputer/skills — MIT
讨论
相关资产
Together AI Dedicated Containers Skill for Agents
Skill that teaches Claude Code Together AI's container deployment API. Run custom Docker inference workers on managed GPU infrastructure with full environment control.
Together AI Embeddings & Reranking Skill for Agents
Skill that teaches Claude Code Together AI's embeddings and reranking API. Covers dense vector generation, semantic search, RAG pipelines, and result reranking patterns.
Together AI Audio TTS/STT Skill for Claude Code
Skill that teaches Claude Code Together AI's audio API. Covers text-to-speech (REST and WebSocket streaming), speech-to-text transcription, and realtime voice interaction.
Together AI Dedicated Endpoints Skill for Agents
Skill that teaches Claude Code Together AI's dedicated endpoints API. Deploy single-tenant GPU inference with autoscaling, no rate limits, and custom model configurations.