Skip to main content

AiChat CLI

A command-line tool for AI Dialogue via the AceDataCloud platform.

Get your Ace Data Cloud API key

  1. Open Ace Data Cloud → Applications. Sign in, or register an account first.
  2. Find General application. If it has not been created, choose Initialize General Application. A general key can use the services available to your account; a dedicated application's key is limited to its service. Check the required service/model access and current pricing.
  3. In General application → API KEY, click the copy button marked 1 below. Use the raw token value without quotes, spaces or Bearer . A platform-... account-management token cannot replace it.

Check the key's service access and balance before submitting; task lookup permission alone does not permit generation. See the detailed key guide (English).

Copy an application API key or open Manage Keys

Save the key in the client's credential store or the environment variable shown below. Never put it in a prompt, shared workflow, screenshot, or Git commit. If authentication fails, check the full copied value, application/service access, expiration, usage limit, and balance before creating another key.

Features

  • Chat with AI — Send questions to GPT, DeepSeek, Grok, GLM, and more models
  • Conversation Continuation — Resume conversations using --id
  • Stateful Sessions — Enable multi-turn context with --stateful
  • References — Inject context documents into prompts with --ref
  • Rich Output — Beautiful terminal formatting with --json for scripting
  • Many Models — GPT-5, GPT-4o, o3, o4-mini, DeepSeek, Grok, GLM, and more

Installation

pip install aichat-pro-cli

Quick Start

export ACEDATACLOUD_API_TOKEN=YOUR_API_TOKEN
aichat chat2 "Hi!" --model gpt-4o --max-turns 1 --json
{
  "id": "f2f4b3e8-0c0a-4d3a-aaa2-7ff80c0a1c44",
  "answer": "Hi! I'm an AI assistant. How can I help you today?"
}

This is the Backend API's documented response example; actual text and IDs vary. Read answer and save your returned id for follow-up operations. See the conversation v2 guide (English). The legacy chat protocol and the newer chat2 model catalog are separate.

More examples

# Set your API token
export ACEDATACLOUD_API_TOKEN=your_token_here

# Ask a question
aichat chat "What is the capital of France?"

# Use a specific model
aichat chat "Explain quantum computing" -m gpt-4o

# Continue a conversation
aichat chat "Tell me more" --id 64a67fff-61dc-4801-8339-2c69334c61d6

# Stateful conversation (server remembers context)
aichat chat "My name is Alice" --stateful
aichat chat "What is my name?" --id <returned-id> --stateful

# With reference documents
aichat chat "Summarize this" --ref "https://example.com/doc.txt"

# Get JSON output
aichat chat "Hello" --json | jq '.answer'

Manage saved conversations

Management actions are case-sensitive and cost 0 Credits. They need no question or model; the CLI omits its default model for these actions. Omitting --action or using --action chat follows the selected model's pricing, with the existing gpt-4o default. Use the id returned by the endpoint you are managing.

aichat chat --action retrieve --id "$CHAT_ID"
aichat chat --action retrieve_batch --ids "$CHAT_ID" --ids "$OTHER_CHAT_ID"
aichat chat --action update --id "$CHAT_ID" --title "Project discussion"
aichat chat --action update --id "$CHAT_ID" --messages '[{"role":"user","content":"Hello"}]'
aichat chat --action delete --id "$CHAT_ID"

Legacy retrieve_batch requires at least one --ids (repeatable), --user-id or --application-id filter. It returns items and count. update returns id, title and messages; delete returns id and deleted. Replacing messages overwrites the entire history; deletion is irreversible. See the legacy conversation guide (English).

Chat2 supports the same four action names, but batch retrieval uses its existing optional filters, not --ids:

aichat chat2 --action retrieve --id "$CHAT2_ID"
aichat chat2 --action retrieve_batch --limit 20
aichat chat2 --action retrieve_batch --model gemini-4-argon --limit 20
aichat chat2 --action update --id "$CHAT2_ID" --title "Project discussion"
aichat chat2 --action delete --id "$CHAT2_ID"

Chat2 batch retrieval returns items and total. No model filter is sent unless you explicitly provide --model. Chat2 update and delete return id and success.

Only Chat2 also supports public sharing. Share only content you intend to make public: share creates or refreshes a public read-only snapshot; unshare revokes it. Both cost 0 Credits and require --id:

aichat chat2 --action share --id "$CHAT2_ID"
aichat chat2 --action unshare --id "$CHAT2_ID"

share returns id, share_id and shared_at; unshare returns id and success. All management actions print the complete JSON response even without --json, rather than treating it as a generated answer.

Unified Chat Completions

aichat completions "Hello" --model kimi-k2.7-code
aichat completions "Explain this" --model gemini-4-argon --json

completions calls /v1/chat/completions with an explicit model ID and Bearer authentication. It does not restrict you to the legacy chat or chat2 command's per-API model suggestions. No model or token limit is silently selected: --max-completion-tokens is optional and only sent when provided. Use messages below for a model that only publishes a Messages endpoint. The commands do not fall back to another protocol.

Native Messages models

Install the existing published package with pip install -U aichat-pro-cli. Models such as claude-sonnet-5-5 require the native Messages protocol:

aichat messages "Hello" --model claude-sonnet-5-5 --max-tokens 128
aichat messages "Summarize this" --model claude-opus-5-5 --max-tokens 128 --json

The command makes one non-streaming request to /v1/messages with your configured Bearer token. A model ID is required and passed through unchanged; no old client-side allowlist prevents newly published Messages models, and no alternate model or protocol is tried. Check the model's published protocol and current pricing before use. --system sets a system prompt and --json preserves the full native response, including tool or usage fields. The existing chat, chat2, models, and models2 commands retain their behavior; their per-API model lists are not the complete cross-protocol catalog.

Commands

Command Description
chat Send a question to an AI model (/aichat/conversations)
chat2 Send a conversation request with structured messages and tool results (/aichat2/conversations)
models List all available models
models2 List models available to chat2
config Show current configuration

Chat Options

Option Description
-m, --model Model to use (default: gpt-4o)
--id Conversation ID to continue
--preset Preset model name
--stateful Enable stateful conversation
--ref Reference URL or text (repeatable)
--json Output raw JSON

Kimi in Chat2

Use kimi-k3.1-pro through chat2; kimi-k3, kimi-k2.6 and kimi-k2.7-code are also available. K2.7 Code targets coding and tool calls at K2.6-tier pricing. K2.5 and the K2 Thinking variants are retired on chat2. Run aichat models2 for this endpoint's list; the legacy chat catalog is separate. See the AiChat v2 guide (English).

aichat chat2 "Review this code and suggest a fix" -m kimi-k3.1-pro --max-turns 1

Gemini 4 Argon in Chat2

gemini-4-argon, gemini-4-carbon, gemini-4-neon and gemini-4-hydrogen are available through chat2, not chat. The model defaults are unchanged; aichat models2 lists the choices for this endpoint.

aichat chat2 "Review this design and its tradeoffs" -m gemini-4-argon --max-turns 1

Claude Fable 5.2 in Chat2

Use the full model ID claude-fable-5-2 through chat2, not chat. Fable 5.1 and Fable 5 remain separate choices; defaults are unchanged. aichat models2 lists the models for this endpoint. Check current model pricing and account access before submitting:

aichat chat2 "Review this design and its tradeoffs" -m claude-fable-5-2 --max-turns 1 --json

For native Claude thinking blocks and tool controls, use the Claude CLI's Messages command instead; Chat2 uses its own conversation format.

Chat2 Turn Limit

aichat chat2 --max-turns accepts integers from 1 to 500 and limits agent iterations (model calls), not conversation history. When omitted, the CLI leaves max_turns out of the request and the server defaults to 500. Each model call is billed by actual usage; a higher limit allows longer tool chains.

Set the limit to 1 for a single answer without tool calls:

aichat chat2 "Explain quantum computing" --max-turns 1

Configuration

Environment Variable Description Default
ACEDATACLOUD_API_TOKEN API authentication token (required)
ACEDATACLOUD_API_BASE_URL API base URL https://api.acedata.cloud
AICHAT_REQUEST_TIMEOUT Request timeout in seconds 30

You can also use a .env file or pass --token directly.

Docker

docker compose run aichat-cli chat "Hello!"

Development

# Install with dev dependencies
pip install -e ".[all]"

# Run tests
pytest

# Run linter
ruff check .
ruff format --check .

License

MIT License - see LICENSE for details.

MiMo

The model lists include mimo-v2.6-pro and mimo-v2.6-flash. Verify the live model catalog, service status and your account access before using chat or chat2 with either ID. Initial scope is text, reasoning and function tools. Command-line model discovery does not grant service access or confirm live availability.

Metadata

Release files for aichat-pro-cli 2026.11.30.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aichat-pro-cli 2026.11.30.0
File Size Uploaded Provenance Actions
aichat_pro_cli-2026.11.30.0.tar.gz 24.9 kB Without provenance Details for aichat_pro_cli-2026.11.30.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aichat-pro-cli 2026.11.30.0
File Interpreter ABI Platform Actions
aichat_pro_cli-2026.11.30.0-py3-none-any.whl Python 3 none any Details for aichat_pro_cli-2026.11.30.0-py3-none-any.whl

Total release size: 43.9 kB

Release files / aichat_pro_cli-2026.11.30.0.tar.gz

Download URL aichat_pro_cli-2026.11.30.0.tar.gz
Size 24.9 kB
Tags Source
SHA-256 checksum
How to use checksums
855a778c2ef42808438838bc19feed2405a4ac031e7058cb9227cda4e1a1f260
BLAKE2b-256 checksum
How to use checksums
5c4ec0e680d90964dbf4ed864900dcf4792e406f0a22c27812483683cfeb2040
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / aichat_pro_cli-2026.11.30.0-py3-none-any.whl

Download URL aichat_pro_cli-2026.11.30.0-py3-none-any.whl
Size 19.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a2323ef5d852204df13b3dabf255b240d9f0cc1e563225fe507c086fb00758a
BLAKE2b-256 checksum
How to use checksums
fdb132ce59fd7442a082c8a07bf9b84988055b590c1dc929fee4478a14ecc77f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for aichat-pro-cli 2026.11.30.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2026.11.30.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page