Skip to main content

Terminal chat for Mesh API — OpenAI-compatible LLM gateway

Project description

meshapi-code

Terminal chat for Mesh API — the OpenAI-compatible LLM gateway. Streaming responses, live markdown, slash commands, real-time cost.

$ meshapi
╭───────────────────────────────╮
│ meshapi 0.1.0                 │
│ model: anthropic/claude-…     │
│ route: default                │
╰───────────────────────────────╯
you > how do I parse SSE in python
… streamed markdown reply …
   142 → 318 tok  •  $0.001234  •  session $0.001234

Install

pipx install meshapi-code           # recommended
uv tool install meshapi-code        # if you use uv
pip install meshapi-code            # plain pip

The PyPI package is meshapi-code; the command on your $PATH is meshapi.

Then:

export MESHAPI_API_KEY=rsk_your_key_here
meshapi

Get a key at meshapi.ai.

What it does

  • Streaming completions with live markdown rendering (rich)
  • Real cost per turn — Mesh API returns cost in the SSE tail; we show it
  • Slash commands/model, /route, /file, /system, /cost, /clear
  • Mid-session model switching/model openai/gpt-4o-mini
  • Smart routing/route cheapest lets the gateway pick (Mesh-specific)
  • Persistent input history — up-arrow recalls past prompts
  • Config + env-var override~/.meshapi/config.json, MESHAPI_API_KEY

Slash commands

Command What it does
/help List commands
/model <name> Switch model (e.g. anthropic/claude-sonnet-4.5)
/route <mode> cheapest, fastest, balanced, or default
/file <path> Inject a file into the conversation
/system <text> Replace system prompt and reset chat
/cost Show cumulative session spend
/clear Reset conversation
/exit Quit

Config

~/.meshapi/config.json:

{
  "base_url": "https://api.meshapi.ai/v1",
  "model": "anthropic/claude-sonnet-4.5",
  "system": "You are a helpful coding assistant. Be concise.",
  "route": null
}

The API key is read from MESHAPI_API_KEY (preferred) or stored in the same file.

Why it exists

Mesh API is OpenAI-compatible, so any generic chat CLI works against it. meshapi adds two things a generic CLI can't: (1) the gateway-only cost field shown after every turn, and (2) routing controls (/route cheapest) that hit Mesh's gateway-side model selection.

Roadmap

  • v0.2 — tool calling, repo-aware mode, diff apply, npm i -g meshapi-code
  • v0.3 — Homebrew tap, curl|sh installer at meshapi.ai/install.sh

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meshapi_code-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meshapi_code-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file meshapi_code-0.1.0.tar.gz.

File metadata

  • Download URL: meshapi_code-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for meshapi_code-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8d18263e8b115dad0903953d1bd6987cb6cd34b74e536a411fba6cc3bb409677
MD5 ba7149fc7b2cb7c9c5fbf6b929670d60
BLAKE2b-256 eb1b19a9cf4f4cb201c752ee09b606ef81b4c3f91b9226c5187205cad18e65ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for meshapi_code-0.1.0.tar.gz:

Publisher: publish.yml on aifiesta/meshapi-code

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file meshapi_code-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: meshapi_code-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for meshapi_code-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e61f665489afa7579467ee515a20653190ea5441841191bdac2b94b51600ef5
MD5 2234e0addcb62d5891985facb5dbb06b
BLAKE2b-256 11c6689037a6ac4e55e72dc6d3a40e85b7dd1f7b83348a77b120903c28650805

See more details on using hashes here.

Provenance

The following attestation bundles were made for meshapi_code-0.1.0-py3-none-any.whl:

Publisher: publish.yml on aifiesta/meshapi-code

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page