Commit f015dfc
docs: fix openai-py base_url examples (must include /v1)
live testing surfaced — openai-py library appends /chat/completions to
base_url, so base_url must include /v1. previously docs showed:
base_url="https://hub.example.com/zai"
which produces a 404 since the hub serves /zai/v1/chat/completions.
correct usage shown now in:
- README.md (added a 'Calling from the OpenAI Python library' subsection
with both non-streaming and streaming examples)
- examples/ZAI_PUBLISH.md (corrected and called out the /v1 requirement
explicitly)
verified live: openai-py 1.x against zhub hub, both stream=False and
stream=True paths work cleanly when /v1 is in base_url. signed manifest
fetch + external verify also confirmed working — verify_manifest()
returns True against /<name>/manifest.json fetched over HTTP.
key pinning verified live: stolen api_key + new ed25519 keypair →
hub returns 'register_failed: key pinning: stored public_key does not
match'. attacker with just an api_key cannot take over a signed
publisher.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 28d9328 commit f015dfc
2 files changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
63 | 82 | | |
64 | 83 | | |
65 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | | - | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
0 commit comments