Documentation Claude Code support
Tool integrations
Claude Code support
Connect Claude Code using the supported model IDs for your environment. Text and stream-json file reads have been verified.
Supported integration#
Claude Code integration is available for Motif 3, GLM 5.3, Kimi K3. Connect with your Morfac API key using the setup below. Tool use and exact output are still being improved.
This guide covers Motif 3, GLM 5.3, Kimi K3, using the Anthropic-compatible /v1/messages API. The model served is the one selected with --model; it is not an Anthropic Claude model. An OpenAI-compatible Chat Completions endpoint alone does not replace this connection.
| Area | Availability |
|---|---|
| Basic text output and file reading | Supported; Read calls, tool results and final replies have been verified |
CLI --output-format stream-json | Supported with Claude Code 2.1.306; use --verbose in print mode |
| File editing and command execution | Outside the verified Read smoke scope; validate actual file changes and command results separately |
| Task completion and exact output | Known limitations: the model may skip a tool call, repeat it, or add line numbers or explanations |
Task completion depends on the model and task. HTTP response streaming and the CLI's stream-json output are separate features. Compatibility with other Claude Code versions and features requires separate validation.
Connect a model#
The verified CLI version is 2.1.306. Create or reuse an active API key in the console. Set MORFAC_API_KEY through your local credential store or a private shell session; never put the key in source control or shared command history.
Choose a model from the table. Change only --model to switch models; the API origin and key stay the same.
| Model | Model ID | Command |
|---|---|---|
| Motif 3 | motif/motif-3 | claude --bare --model motif/motif-3 |
| GLM 5.3 | z-ai/glm-5.3 | claude --bare --model z-ai/glm-5.3 |
| Kimi K3 | moonshotai/kimi-k3 | claude --bare --model moonshotai/kimi-k3 |
The list describes supported connections. Check the authenticated GET /v1/models response for current callable and blocking_reasons; a listed model can be temporarily unavailable. Read and exact final output were verified in text and stream-json modes; this does not establish equal coding quality across models.
In a separate terminal, set the connection for that session:
export ANTHROPIC_BASE_URL="https://api.dev.morphfactory.io"
export ANTHROPIC_API_KEY="$MORFAC_API_KEY"
claude --bare --model motif/motif-3Do not append /v1 to ANTHROPIC_BASE_URL. --bare uses the minimal CLI path used in validation. Keep your existing configuration and credentials; this example does not replace your settings file. Choose only the file and command permissions needed for your task.
For newline-delimited JSON output in print mode:
claude --bare --model motif/motif-3 --verbose --output-format stream-json -p "Say hello briefly."Start with a short text request, then check an actual Read operation on a non-sensitive file before relying on a project workflow. Requests use your Morfac credits. See the Claude Code gateway documentation for CLI gateway requirements; the model connection described here is provided by Morfac.
File-reading request examples#
Specify the file, the tool to use and the final answer format together. Replace the example path below with a file in your project.
Case 1: Ask for an actual file read
Instead of “check the file,” make the first action explicit.
Your first action must be to call the Read tool on ./sample.txt.
Do not guess the file contents or simulate a tool call in text.
If Read fails, report the error instead of inventing contents.Check that Claude Code shows an actual Read execution and its tool result, rather than relying only on file contents appearing in the final reply.
Case 2: Get the file contents without line numbers
This example assumes the file contains exactly one line.
Even “reply with one line only” can produce the line numbers shown by Read or an added explanation. Explicitly name what to omit.
Your first action must be to call the Read tool on ./sample.txt.
After Read succeeds, copy the file's single line exactly as your entire final answer.
The line numbers shown by Read are display metadata: omit them.
Do not add quotes, Markdown, a prefix, or an explanation.
If Read fails, report the error instead of inventing contents.For example, if the file's one line is MORFAC_READ_OK, the final answer should be only MORFAC_READ_OK. A line number or a “File contents:” prefix is a format mismatch.
These instructions do not guarantee success. If the model repeatedly reads the same file or keeps returning the wrong format, stop the task and compare the actual tool result with the final answer. Applications consuming the output should also validate it against the expected format.
Connection troubleshooting#
Authentication errors
Check that your API key is active in the console.
Origin or model errors
Use https://api.dev.morphfactory.io as the API origin. Do not append /v1.
Use one of these exact model IDs: motif/motif-3, z-ai/glm-5.3, moonshotai/kimi-k3. A custom-model context-window warning alone is not an API failure; check the actual response and the model catalog for its context limit.
Temporary provider limits or unavailability
A provider 429 is a request limit, while a 503 can indicate that the gateway has no ready route. Check current model availability, retain the request ID and respect any Retry-After value. Avoid immediate repeated retries. These errors do not by themselves establish a bad key or insufficient credits.
Output mode errors
The connection supports --output-format stream-json with the verified CLI version. In print mode, include --verbose. If it fails, check the CLI version and error, then try basic text output to separate connection errors from output-mode errors.
Check file edits and tests
Inspect the actual file changes and test results. Do not rely on a final reply alone to confirm completion.
Keep files under version control and allow only the files and commands needed for the task.
Contact support
Include your Claude Code version, error message and time of occurrence. Add the request ID if available.
Exclude API keys, authorization headers, passwords and private project content.
Other connection options#
Use the Quickstart for direct Chat Completions requests, or choose another tool guide.