Skip to content

Commit 58cc70a

Browse files
balogh.adam@icloud.comclaude
andcommitted
update docs and tutorials to use new settlement mode names
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 34b64b6 commit 58cc70a

7 files changed

Lines changed: 41 additions & 41 deletions

File tree

.claude/skills/opengradient/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ client.llm.ensure_opg_approval(opg_amount=5)
6868

6969
## Settlement Modes (`og.x402SettlementMode`)
7070

71-
- `SETTLE` — Hashes only (maximum privacy)
72-
- `SETTLE_METADATA` — Full data on-chain (maximum transparency)
73-
- `SETTLE_BATCH` — Aggregated hashes (most cost-efficient, default)
71+
- `PRIVATE` — Hashes only (maximum privacy)
72+
- `INDIVIDUAL_FULL` — Full data on-chain (maximum transparency)
73+
- `BATCH_HASHED` — Aggregated hashes (most cost-efficient, default)
7474

7575
## Core Patterns
7676

.claude/skills/opengradient/api-reference.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ client.llm.chat(
4646
stream: bool = False,
4747
tools: list[dict] = None, # Function definitions
4848
tool_choice: str = None, # "auto", "none", or specific
49-
x402_settlement_mode: og.x402SettlementMode = og.x402SettlementMode.SETTLE_BATCH,
49+
x402_settlement_mode: og.x402SettlementMode = og.x402SettlementMode.BATCH_HASHED,
5050
) -> TextGenerationOutput | TextGenerationStream
5151
```
5252

@@ -137,9 +137,9 @@ Returned by `client.alpha.infer()`.
137137

138138
| Mode | Value | Description |
139139
|------|-------|-------------|
140-
| `SETTLE` | `"private"` | Hashes only — maximum privacy |
141-
| `SETTLE_METADATA` | `"individual"` | Full data on-chain — maximum transparency |
142-
| `SETTLE_BATCH` | `"batch"` | Aggregated hashes — most cost-efficient (default) |
140+
| `PRIVATE` | `"private"` | Hashes only — maximum privacy |
141+
| `INDIVIDUAL_FULL` | `"individual"` | Full data on-chain — maximum transparency |
142+
| `BATCH_HASHED` | `"batch"` | Aggregated hashes — most cost-efficient (default) |
143143

144144
---
145145

@@ -242,7 +242,7 @@ llm = og.agents.langchain_adapter(
242242
private_key: str,
243243
model_cid: og.TEE_LLM,
244244
max_tokens: int = 300,
245-
x402_settlement_mode: og.x402SettlementMode = og.x402SettlementMode.SETTLE_BATCH,
245+
x402_settlement_mode: og.x402SettlementMode = og.x402SettlementMode.BATCH_HASHED,
246246
)
247247
```
248248

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,16 +293,16 @@ Manage, host, and execute models through the Model Hub with direct integration i
293293

294294
OpenGradient supports multiple settlement modes through the x402 payment protocol:
295295

296-
- **SETTLE**: Records cryptographic hashes only (maximum privacy)
297-
- **SETTLE_METADATA**: Records complete input/output data (maximum transparency)
298-
- **SETTLE_BATCH**: Aggregates multiple inferences (most cost-efficient)
296+
- **PRIVATE**: Payment only, no input/output data on-chain (maximum privacy)
297+
- **BATCH_HASHED**: Aggregates inferences into a Merkle tree with input/output hashes and signatures (most cost-efficient, default)
298+
- **INDIVIDUAL_FULL**: Records input, output, timestamp, and verification on-chain (maximum auditability)
299299

300300
Specify settlement mode in your requests:
301301
```python
302302
result = client.llm.chat(
303303
model=og.TEE_LLM.GPT_5,
304304
messages=[{"role": "user", "content": "Hello"}],
305-
x402_settlement_mode=og.x402SettlementMode.SETTLE_BATCH,
305+
x402_settlement_mode=og.x402SettlementMode.BATCH_HASHED,
306306
)
307307
```
308308

docs/CLAUDE_SDK_USERS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ result = client.llm.chat(
5959
tools: List[Dict] = [], # Optional: function calling
6060
tool_choice: str = None, # "auto", "none", or specific tool
6161
stop_sequence: List[str] = None,
62-
x402_settlement_mode: x402SettlementMode = x402SettlementMode.SETTLE_BATCH,
62+
x402_settlement_mode: x402SettlementMode = x402SettlementMode.BATCH_HASHED,
6363
stream: bool = False, # Enable streaming responses
6464
)
6565
# Returns: TextGenerationOutput (or TextGenerationStream if stream=True)
@@ -78,7 +78,7 @@ result = client.llm.completion(
7878
max_tokens: int = 100,
7979
temperature: float = 0.0,
8080
stop_sequence: List[str] = None,
81-
x402_settlement_mode: x402SettlementMode = x402SettlementMode.SETTLE_BATCH,
81+
x402_settlement_mode: x402SettlementMode = x402SettlementMode.BATCH_HASHED,
8282
)
8383
# Returns: TextGenerationOutput
8484
# - completion_output: str (raw text)
@@ -272,9 +272,9 @@ og.InferenceMode.TEE # Trusted Execution Environment
272272
og.InferenceMode.ZKML # Zero-knowledge proof
273273

274274
# x402 Payment Settlement Modes (for LLM calls)
275-
og.x402SettlementMode.SETTLE # Input/output hashes only (most private)
276-
og.x402SettlementMode.SETTLE_BATCH # Batch hashes (most cost-efficient, default)
277-
og.x402SettlementMode.SETTLE_METADATA # Full data and metadata on-chain
275+
og.x402SettlementMode.PRIVATE # Input/output hashes only (most private)
276+
og.x402SettlementMode.BATCH_HASHED # Batch hashes (most cost-efficient, default)
277+
og.x402SettlementMode.INDIVIDUAL_FULL # Full data and metadata on-chain
278278

279279
# Workflow data types
280280
og.CandleType.OPEN, .HIGH, .LOW, .CLOSE, .VOLUME

tutorials/01-verifiable-ai-agent.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ llm = og.agents.langchain_adapter(
5858
private_key=private_key,
5959
model_cid=og.TEE_LLM.GPT_4_1_2025_04_14,
6060
max_tokens=500,
61-
x402_settlement_mode=og.x402SettlementMode.SETTLE_BATCH,
61+
x402_settlement_mode=og.x402SettlementMode.BATCH_HASHED,
6262
)
6363
```
6464

@@ -223,9 +223,9 @@ is recorded on-chain:
223223

224224
| Mode | What's Stored | Best For |
225225
|------|--------------|----------|
226-
| `SETTLE` | Hashes of input and output only | **Privacy** -- proves execution happened without revealing content |
227-
| `SETTLE_BATCH` | Batch hash of multiple inferences | **Cost efficiency** -- reduces per-call gas costs (default) |
228-
| `SETTLE_METADATA` | Full model info, input, output, and metadata | **Transparency** -- complete auditability for compliance |
226+
| `PRIVATE` | Hashes of input and output only | **Privacy** -- proves execution happened without revealing content |
227+
| `BATCH_HASHED` | Batch hash of multiple inferences | **Cost efficiency** -- reduces per-call gas costs (default) |
228+
| `INDIVIDUAL_FULL` | Full model info, input, output, and metadata | **Transparency** -- complete auditability for compliance |
229229

230230
Choose based on your requirements:
231231

@@ -234,21 +234,21 @@ Choose based on your requirements:
234234
llm_dev = og.agents.langchain_adapter(
235235
private_key=os.environ["OG_PRIVATE_KEY"],
236236
model_cid=og.TEE_LLM.GPT_4_1_2025_04_14,
237-
x402_settlement_mode=og.x402SettlementMode.SETTLE_BATCH,
237+
x402_settlement_mode=og.x402SettlementMode.BATCH_HASHED,
238238
)
239239

240240
# For production financial applications -- full audit trail
241241
llm_prod = og.agents.langchain_adapter(
242242
private_key=os.environ["OG_PRIVATE_KEY"],
243243
model_cid=og.TEE_LLM.GPT_4_1_2025_04_14,
244-
x402_settlement_mode=og.x402SettlementMode.SETTLE_METADATA,
244+
x402_settlement_mode=og.x402SettlementMode.INDIVIDUAL_FULL,
245245
)
246246

247247
# For privacy-sensitive applications -- minimal on-chain footprint
248248
llm_private = og.agents.langchain_adapter(
249249
private_key=os.environ["OG_PRIVATE_KEY"],
250250
model_cid=og.TEE_LLM.GPT_4_1_2025_04_14,
251-
x402_settlement_mode=og.x402SettlementMode.SETTLE,
251+
x402_settlement_mode=og.x402SettlementMode.PRIVATE,
252252
)
253253
```
254254

@@ -299,7 +299,7 @@ llm = og.agents.langchain_adapter(
299299
private_key=private_key,
300300
model_cid=og.TEE_LLM.GPT_4_1_2025_04_14,
301301
max_tokens=500,
302-
x402_settlement_mode=og.x402SettlementMode.SETTLE_BATCH,
302+
x402_settlement_mode=og.x402SettlementMode.BATCH_HASHED,
303303
)
304304

305305
# ── Standard tool ─────────────────────────────────────────────────────────
@@ -356,5 +356,5 @@ if __name__ == "__main__":
356356
models deployed on OpenGradient.
357357
- **Read workflow results**: Use `og.alphasense.create_read_workflow_tool` to read
358358
from scheduled on-chain workflows that run models automatically.
359-
- **Go to production**: Switch settlement mode to `SETTLE_METADATA` and store the
359+
- **Go to production**: Switch settlement mode to `INDIVIDUAL_FULL` and store the
360360
payment hashes and transaction hashes for your compliance records.

tutorials/02-streaming-multi-provider.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,17 @@ privacy/cost/transparency trade-off:
163163

164164
| Mode | On-Chain Data | Use Case |
165165
|------|--------------|----------|
166-
| `SETTLE` | Input/output hashes only | **Privacy** -- prove execution without revealing content |
167-
| `SETTLE_BATCH` | Batch digest of multiple calls | **Cost efficiency** -- lower gas per inference (default) |
168-
| `SETTLE_METADATA` | Full model, input, output, metadata | **Transparency** -- complete audit trail |
166+
| `PRIVATE` | Input/output hashes only | **Privacy** -- prove execution without revealing content |
167+
| `BATCH_HASHED` | Batch digest of multiple calls | **Cost efficiency** -- lower gas per inference (default) |
168+
| `INDIVIDUAL_FULL` | Full model, input, output, metadata | **Transparency** -- complete audit trail |
169169

170170
```python
171171
# Privacy-first: only hashes stored on-chain
172172
result_private = client.llm.chat(
173173
model=og.TEE_LLM.CLAUDE_SONNET_4_6,
174174
messages=[{"role": "user", "content": "Sensitive query here."}],
175175
max_tokens=100,
176-
x402_settlement_mode=og.x402SettlementMode.SETTLE,
176+
x402_settlement_mode=og.x402SettlementMode.PRIVATE,
177177
)
178178
print(f"Payment hash (SETTLE): {result_private.payment_hash}")
179179

@@ -182,18 +182,18 @@ result_batch = client.llm.chat(
182182
model=og.TEE_LLM.CLAUDE_SONNET_4_6,
183183
messages=[{"role": "user", "content": "Regular query."}],
184184
max_tokens=100,
185-
x402_settlement_mode=og.x402SettlementMode.SETTLE_BATCH,
185+
x402_settlement_mode=og.x402SettlementMode.BATCH_HASHED,
186186
)
187-
print(f"Payment hash (SETTLE_BATCH): {result_batch.payment_hash}")
187+
print(f"Payment hash (BATCH_HASHED): {result_batch.payment_hash}")
188188

189189
# Full transparency: everything on-chain
190190
result_transparent = client.llm.chat(
191191
model=og.TEE_LLM.CLAUDE_SONNET_4_6,
192192
messages=[{"role": "user", "content": "Auditable query."}],
193193
max_tokens=100,
194-
x402_settlement_mode=og.x402SettlementMode.SETTLE_METADATA,
194+
x402_settlement_mode=og.x402SettlementMode.INDIVIDUAL_FULL,
195195
)
196-
print(f"Payment hash (SETTLE_METADATA): {result_transparent.payment_hash}")
196+
print(f"Payment hash (INDIVIDUAL_FULL): {result_transparent.payment_hash}")
197197
```
198198

199199
All three calls return a `payment_hash` you can look up on-chain. The difference is
@@ -308,9 +308,9 @@ print("\n")
308308

309309
# ── Settlement modes ──────────────────────────────────────────────────────
310310
for mode_name, mode in [
311-
("SETTLE", og.x402SettlementMode.SETTLE),
312-
("SETTLE_BATCH", og.x402SettlementMode.SETTLE_BATCH),
313-
("SETTLE_METADATA", og.x402SettlementMode.SETTLE_METADATA),
311+
("PRIVATE", og.x402SettlementMode.PRIVATE),
312+
("BATCH_HASHED", og.x402SettlementMode.BATCH_HASHED),
313+
("INDIVIDUAL_FULL", og.x402SettlementMode.INDIVIDUAL_FULL),
314314
]:
315315
try:
316316
r = client.llm.chat(

tutorials/03-verified-tool-calling.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ result = client.llm.chat(
179179
# "auto" lets the model decide whether to call a tool or respond with text.
180180
# "none" forces a text-only response.
181181
tool_choice="auto",
182-
x402_settlement_mode=og.x402SettlementMode.SETTLE_BATCH,
182+
x402_settlement_mode=og.x402SettlementMode.BATCH_HASHED,
183183
)
184184
```
185185

@@ -225,7 +225,7 @@ def run_agent(client: og.Client, user_query: str) -> str:
225225
temperature=0.0,
226226
tools=TOOLS,
227227
tool_choice="auto",
228-
x402_settlement_mode=og.x402SettlementMode.SETTLE_BATCH,
228+
x402_settlement_mode=og.x402SettlementMode.BATCH_HASHED,
229229
)
230230
except Exception as e:
231231
print(f" LLM call failed: {e}")
@@ -376,7 +376,7 @@ def run_agent(user_query: str) -> str:
376376
result = client.llm.chat(
377377
model=og.TEE_LLM.GPT_5, messages=messages, max_tokens=600,
378378
temperature=0.0, tools=TOOLS, tool_choice="auto",
379-
x402_settlement_mode=og.x402SettlementMode.SETTLE_BATCH,
379+
x402_settlement_mode=og.x402SettlementMode.BATCH_HASHED,
380380
)
381381
except Exception as e:
382382
return f"Error: {e}"
@@ -409,5 +409,5 @@ if __name__ == "__main__":
409409
even during multi-turn tool loops. See **Tutorial 2** for streaming basics.
410410
- **Use different providers**: Swap `og.TEE_LLM.GPT_5` for `CLAUDE_SONNET_4_6` or
411411
`GEMINI_2_5_FLASH` -- tool calling works across all providers.
412-
- **Add settlement transparency**: Switch to `SETTLE_METADATA` to store the full
412+
- **Add settlement transparency**: Switch to `INDIVIDUAL_FULL` to store the full
413413
tool-calling reasoning chain on-chain for audit purposes.

0 commit comments

Comments
 (0)