---
type: Attested Computation
title: cohere
identifier: llm/cohere
description: One Cohere chat completion (api.cohere.com/v2/chat) from a prompt file or inline prompt, with an optional system prompt file, written to response.md. The host is fixed -- there is no base-URL parameter -- so the API key can only ever be sent to Cohere. seed makes sampling best-effort reproducible; stdout is a one-line summary (model, seed, tokens, finish reason), never the completion.
pack: llm
tags:
- internet
runtime: fragletc
image: ofthemachine/python3@sha256:a015b4f9f0e7c1648f8fcd4164f6a296dd3c9189404f88f333a9764d08d13522
network: required
stdin: none
execution_class: environmental
procedure_hash: sha256:b1c44eae8703887a6054929025928cfacd289a88aaf4b916a8bb63cf3eaa339d
parameters:
- name: prompt
  type: file
  required: false
  description: Prompt file (the user message)
- name: prompt_text
  type: string
  required: false
  description: Inline prompt, when there is no prompt file
- name: system
  type: file
  required: false
  description: System prompt file
- name: model
  type: string
  required: false
  default: command-a-03-2025
  description: Cohere model id
- name: temperature
  type: string
  required: false
  default: '0.7'
  description: Sampling temperature, 0 to 1
- name: seed
  type: string
  required: false
  default: '42'
  description: Sampling seed; same seed and inputs give best-effort identical output
- name: max_tokens
  type: string
  required: false
  default: '1024'
  description: Maximum tokens to generate (a thinking model's thinking counts)
- name: thinking_budget
  type: string
  required: false
  description: 'For a thinking model (e.g. command-a-plus-05-2026): the most tokens it may think before answering, so the answer fits max_tokens; empty: the model''s default'
computation: https://tools.ofthemachine.com/llm/cohere.py
executor:
  resource: https://github.com/ofthemachine/fraglet
  receipt:
  - schema
  - fragletc
  - procedure
  - procedure_hash
  - image
  - image_digest
  - network
  - stdin_mode
  - params
  - inputs
  - argv
  - env
  - memo_key
  - started
  - finished
  - exit_code
  - stdout
  - outputs
  format: fraglet-receipt/2 (fragletc --receipt <path>, or FRAGLETC_RECEIPT_DIR)
attester:
  resource: https://tools.ofthemachine.com/receipt/attest.py
  method: 'deterministic, no re-execution: procedure_hash equals sha256 of computation; memo_key recomputes from the receipt''s own fields; claimed params and any artifact hash match the receipt'
generated:
  by: process:tools/catalog/compile.py
  at: '2026-11-13T18:27:40Z'
secrets:
- COHERE_API_KEY
outputs:
- response.md
---

# cohere

One Cohere chat completion (api.cohere.com/v2/chat) from a prompt file or inline prompt, with an optional system prompt file, written to response.md. The host is fixed -- there is no base-URL parameter -- so the API key can only ever be sent to Cohere. seed makes sampling best-effort reproducible; stdout is a one-line summary (model, seed, tokens, finish reason), never the completion.

Use when a workflow step needs text generated by a language model -- a poem, a caption, a summary -- from a prompt file, and a Cohere API key (free trial keys work) is available.

# Schema

## Parameters
- `prompt` (file, optional) — Prompt file (the user message)
- `prompt_text` (string, optional) — Inline prompt, when there is no prompt file
- `system` (file, optional) — System prompt file
- `model` (string, optional, default `command-a-03-2025`) — Cohere model id
- `temperature` (string, optional, default `0.7`) — Sampling temperature, 0 to 1
- `seed` (string, optional, default `42`) — Sampling seed; same seed and inputs give best-effort identical output
- `max_tokens` (string, optional, default `1024`) — Maximum tokens to generate (a thinking model's thinking counts)
- `thinking_budget` (string, optional) — For a thinking model (e.g. command-a-plus-05-2026): the most tokens it may think before answering, so the answer fits max_tokens; empty: the model's default
- `COHERE_API_KEY` (secret, required) — read from the caller's environment, never passed with `-p`; Cohere API key (trial keys: 1,000 calls/month)

## Outputs
- `response.md` (declared file under /output)

# Execution

The computation is [`llm/cohere.py`](https://tools.ofthemachine.com/llm/cohere.py) (frontmatter `computation`; in `tools.tar.gz` the same file sits at `llm/cohere.py` beside this bundle), run by `fragletc` in `ofthemachine/python3@sha256:a015b4f9f0e7c1648f8fcd4164f6a296dd3c9189404f88f333a9764d08d13522` with network `required`. Its identity is `procedure_hash` = sha256 of that file, shebang included — the same value every receipt records. Parameters are passed as `-p name=value`; `--receipt run.json` (or `FRAGLETC_RECEIPT_DIR`) writes the receipt, a `fraglet-receipt/2` JSON document with the fields listed under `executor.receipt`.

# Attestation

A run's receipt is attested with [`receipt/attest.py`](https://tools.ofthemachine.com/receipt/attest.py): the computation that ran is this script (`procedure_hash`), the receipt is internally consistent (`memo_key` recomputes from its own fields), the claimed parameters are the ones that ran, and an artifact claimed as an output hashes to what the receipt recorded. No re-execution: attestation is provenance fidelity, not reproduction.

Environmental: the tool reaches the network, so outputs depend on state outside its inputs; the receipt records exactly what ran and what came out and makes no reproduction claim.

Skill: [SKILL.md](https://tools.ofthemachine.com/llm/SKILL.md)
