image-skill 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/bin/image-skill.mjs +1524 -0
- package/cli.md +856 -0
- package/llms.txt +221 -0
- package/package.json +24 -0
- package/skill.md +318 -0
package/cli.md
ADDED
|
@@ -0,0 +1,856 @@
|
|
|
1
|
+
# Image Skill CLI Contract
|
|
2
|
+
|
|
3
|
+
Status: preview hosted-product contract.
|
|
4
|
+
|
|
5
|
+
The `image-skill` thin CLI/client gives agents a stable way to call the hosted Image Skill service, parse JSON responses, receive artifacts, and leave feedback.
|
|
6
|
+
|
|
7
|
+
Public contract URLs:
|
|
8
|
+
|
|
9
|
+
- `https://image-skill.com`
|
|
10
|
+
- `https://image-skill.com/skill.md`
|
|
11
|
+
- `https://image-skill.com/llms.txt`
|
|
12
|
+
- `https://image-skill.com/cli.md`
|
|
13
|
+
- `https://api.image-skill.com`
|
|
14
|
+
|
|
15
|
+
## Global Rules
|
|
16
|
+
|
|
17
|
+
- Every command that agents use must support `--json`.
|
|
18
|
+
- JSON output must use the standard envelope from `https://image-skill.com/llms.txt`.
|
|
19
|
+
- Commands must have deterministic exit codes.
|
|
20
|
+
- Commands must emit service telemetry unless running in a documented no-telemetry test mode.
|
|
21
|
+
- Commands must not print secrets after initial creation.
|
|
22
|
+
- File-writing commands must avoid overwriting inputs unless `--overwrite` is explicit.
|
|
23
|
+
- Expensive commands must expose quota, claim, cost, and budget guard failures clearly.
|
|
24
|
+
- Public feedback commands submit to hosted product memory by default.
|
|
25
|
+
|
|
26
|
+
## Exit Codes
|
|
27
|
+
|
|
28
|
+
| Code | Meaning |
|
|
29
|
+
| ---- | -------------------------------------- |
|
|
30
|
+
| 0 | Success |
|
|
31
|
+
| 1 | Generic failure |
|
|
32
|
+
| 2 | Invalid arguments |
|
|
33
|
+
| 3 | Auth required or invalid token |
|
|
34
|
+
| 4 | Capability denied |
|
|
35
|
+
| 5 | Quota exceeded |
|
|
36
|
+
| 6 | Content policy denied |
|
|
37
|
+
| 7 | Provider failure |
|
|
38
|
+
| 8 | Timeout |
|
|
39
|
+
| 9 | Filesystem or artifact storage failure |
|
|
40
|
+
|
|
41
|
+
## Commands
|
|
42
|
+
|
|
43
|
+
### `image-skill doctor`
|
|
44
|
+
|
|
45
|
+
Checks thin CLI/client health, hosted service reachability, auth state, local output permissions, and telemetry status.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
image-skill doctor --json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### `image-skill signup --agent`
|
|
52
|
+
|
|
53
|
+
Bootstraps restricted agent access.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
image-skill signup --agent \
|
|
57
|
+
--human-email human@example.com \
|
|
58
|
+
--agent-name creative-agent \
|
|
59
|
+
--runtime codex \
|
|
60
|
+
--save \
|
|
61
|
+
--json
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`--save` stores the returned `isk_r_` token in the public CLI config with 0600
|
|
65
|
+
permissions and redacts it from stdout. Use `--show-token` only when the agent
|
|
66
|
+
runtime has a separate secret store and needs the raw token once. Do not paste
|
|
67
|
+
tokens into prompts, logs, issue text, or feedback.
|
|
68
|
+
|
|
69
|
+
For shell-based agent runtimes, store the token outside prompts and then expose
|
|
70
|
+
it as:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
export IMAGE_SKILL_TOKEN="isk_r_..."
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
If the agent runtime can hand secrets to a command over stdin, avoid exporting
|
|
77
|
+
the token and use `--token-stdin` instead:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
printf '%s\n' "$IMAGE_SKILL_TOKEN" | image-skill usage quota --token-stdin --json
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`--api-base-url` is an advanced preview/test override; production public agents
|
|
84
|
+
should omit it.
|
|
85
|
+
|
|
86
|
+
### `image-skill whoami`
|
|
87
|
+
|
|
88
|
+
Shows current actor, organization, claim state, token class, and grants.
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
image-skill whoami --json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### `image-skill usage quota`
|
|
95
|
+
|
|
96
|
+
Canonical pre-spend check. Shows remaining credits, job limits, model limits,
|
|
97
|
+
and reset windows before create/edit.
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
image-skill usage quota --json
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`image-skill quota --json` remains a compatibility alias.
|
|
104
|
+
|
|
105
|
+
Hosted API equivalent:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
curl -sS https://api.image-skill.com/v1/quota \
|
|
109
|
+
-H "authorization: Bearer $IMAGE_SKILL_TOKEN"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### `image-skill credits packs list`
|
|
113
|
+
|
|
114
|
+
Lists the recommended Image Skill credit packs for Stripe Checkout. Packs are
|
|
115
|
+
the default live-money buying UX because agents get obvious starter choices and
|
|
116
|
+
Stripe Checkout avoids tiny card-fee traps. Exact custom quotes are still
|
|
117
|
+
supported when an agent already knows the required credit budget.
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
image-skill credits packs list --json
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Minimum success data:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"credit_unit_cents": 1,
|
|
128
|
+
"credit_unit_usd": 0.01,
|
|
129
|
+
"currency": "USD",
|
|
130
|
+
"default_pack_id": "starter-500",
|
|
131
|
+
"packs": [
|
|
132
|
+
{
|
|
133
|
+
"pack_id": "starter-500",
|
|
134
|
+
"name": "Starter",
|
|
135
|
+
"credits": 500,
|
|
136
|
+
"amount_cents": 500,
|
|
137
|
+
"currency": "USD"
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"custom_quotes": {
|
|
141
|
+
"supported": true,
|
|
142
|
+
"min_credits": 1,
|
|
143
|
+
"max_credits": 5000
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Hosted API equivalent:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
curl -sS https://api.image-skill.com/v1/credit-packs
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### `image-skill credits quote`
|
|
155
|
+
|
|
156
|
+
Requests a bounded credit quote from the hosted service. By default this uses
|
|
157
|
+
the harness-safe fake/test settlement rail; agents can request Stripe Checkout
|
|
158
|
+
terms with `--payment-method stripe_checkout`. A quote never grants credits.
|
|
159
|
+
One Image Skill credit is a stable user-facing value unit worth `$0.01`.
|
|
160
|
+
Creative operations can consume more than one credit based on the selected
|
|
161
|
+
model's provider cost and Image Skill's margin policy; inspect
|
|
162
|
+
`models show MODEL_ID --json` and operation `cost.credit_pricing` for the exact
|
|
163
|
+
debit before spending.
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
image-skill credits quote --credits 10 --json
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
For retry-stable automation, provide an explicit non-secret idempotency key:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
image-skill credits quote \
|
|
173
|
+
--credits 10 \
|
|
174
|
+
--idempotency-key quote-run-001 \
|
|
175
|
+
--json
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
For Stripe Checkout terms, prefer a named pack:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
image-skill credits quote \
|
|
182
|
+
--pack starter-500 \
|
|
183
|
+
--payment-method stripe_checkout \
|
|
184
|
+
--idempotency-key stripe-pack-quote-run-001 \
|
|
185
|
+
--json
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
For exact custom Stripe Checkout terms, request the provider and bounded credit
|
|
189
|
+
amount explicitly:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
image-skill credits quote \
|
|
193
|
+
--credits 137 \
|
|
194
|
+
--payment-method stripe_checkout \
|
|
195
|
+
--idempotency-key exact-quote-run-001 \
|
|
196
|
+
--json
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Minimum success data:
|
|
200
|
+
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"quote_id": "quote_...",
|
|
204
|
+
"state": "created",
|
|
205
|
+
"credits": 10,
|
|
206
|
+
"price_amount_cents": 10,
|
|
207
|
+
"currency": "USD",
|
|
208
|
+
"expires_at": "2026-05-08T20:00:00.000Z",
|
|
209
|
+
"accepted_payment_method": "fake",
|
|
210
|
+
"idempotency_key": "quote-run-001",
|
|
211
|
+
"pack_id": null,
|
|
212
|
+
"pack": null,
|
|
213
|
+
"live_money": false
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Hosted API equivalent:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
curl -sS https://api.image-skill.com/v1/credit-quotes \
|
|
221
|
+
-H "authorization: Bearer $IMAGE_SKILL_TOKEN" \
|
|
222
|
+
-H "content-type: application/json" \
|
|
223
|
+
-d '{"pack_id":"starter-500","payment_method":"stripe_checkout","idempotency_key":"stripe-pack-quote-run-001"}'
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### `image-skill credits buy`
|
|
227
|
+
|
|
228
|
+
Creates a live-provider payment action for a previously returned quote. Stripe
|
|
229
|
+
Checkout is the first supported provider. This creates a hosted Stripe Checkout
|
|
230
|
+
Session and returns an `action_required` response with `checkout_url`; credits
|
|
231
|
+
are granted only after verified Stripe webhook fulfillment succeeds. Session
|
|
232
|
+
creation itself must not mutate credit balances.
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
image-skill credits buy \
|
|
236
|
+
--provider stripe \
|
|
237
|
+
--quote-id quote_... \
|
|
238
|
+
--idempotency-key stripe-buy-run-001 \
|
|
239
|
+
--json
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Minimum success data:
|
|
243
|
+
|
|
244
|
+
```json
|
|
245
|
+
{
|
|
246
|
+
"state": "action_required",
|
|
247
|
+
"quote_id": "quote_...",
|
|
248
|
+
"payment_attempt_id": "payatt_...",
|
|
249
|
+
"provider": "stripe",
|
|
250
|
+
"accepted_payment_method": "stripe_checkout",
|
|
251
|
+
"checkout_session_id": "cs_...",
|
|
252
|
+
"checkout_url": "https://checkout.stripe.com/...",
|
|
253
|
+
"credits": 500,
|
|
254
|
+
"amount_cents": 500,
|
|
255
|
+
"currency": "USD",
|
|
256
|
+
"live_money": true,
|
|
257
|
+
"next": {
|
|
258
|
+
"human_action": "open_checkout_url",
|
|
259
|
+
"after_payment": "poll image-skill credits status --payment-attempt-id PAYMENT_ATTEMPT_ID --json or image-skill usage quota --json; credits are granted only after verified webhook fulfillment"
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Hosted API equivalent:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
curl -sS https://api.image-skill.com/v1/credit-purchases/stripe-checkout-sessions \
|
|
268
|
+
-H "authorization: Bearer $IMAGE_SKILL_TOKEN" \
|
|
269
|
+
-H "content-type: application/json" \
|
|
270
|
+
-d '{"quote_id":"quote_...","idempotency_key":"stripe-buy-run-001"}'
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### `image-skill credits status`
|
|
274
|
+
|
|
275
|
+
Shows the durable state of a quote, Stripe Checkout attempt, Checkout Session,
|
|
276
|
+
or receipt. Use this after `credits buy` so agents do not have to infer payment
|
|
277
|
+
state from quota deltas or activity text.
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
image-skill credits status \
|
|
281
|
+
--payment-attempt-id payatt_... \
|
|
282
|
+
--json
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Exactly one reference flag is required: `--quote-id`,
|
|
286
|
+
`--payment-attempt-id`, `--checkout-session-id`, or `--receipt-id`.
|
|
287
|
+
|
|
288
|
+
Minimum action-required data:
|
|
289
|
+
|
|
290
|
+
```json
|
|
291
|
+
{
|
|
292
|
+
"state": "action_required",
|
|
293
|
+
"quote": {
|
|
294
|
+
"quote_id": "quote_...",
|
|
295
|
+
"credits": 500,
|
|
296
|
+
"price_amount_cents": 500,
|
|
297
|
+
"accepted_payment_method": "stripe_checkout",
|
|
298
|
+
"pack_id": "starter-500"
|
|
299
|
+
},
|
|
300
|
+
"payment_attempt": {
|
|
301
|
+
"payment_attempt_id": "payatt_...",
|
|
302
|
+
"checkout_session_id": "cs_...",
|
|
303
|
+
"checkout_url": "https://checkout.stripe.com/...",
|
|
304
|
+
"attempt_status": "requires_action"
|
|
305
|
+
},
|
|
306
|
+
"receipt": null,
|
|
307
|
+
"credit_event": null,
|
|
308
|
+
"next": {
|
|
309
|
+
"retry_after_seconds": 10,
|
|
310
|
+
"human_action": "open_checkout_url"
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
Minimum success data includes `state: "succeeded"`, `receipt`,
|
|
316
|
+
`credit_event`, and the updated hosted `limits`.
|
|
317
|
+
|
|
318
|
+
Hosted API equivalent:
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
curl -sS "https://api.image-skill.com/v1/credit-purchases/status?payment_attempt_id=payatt_..." \
|
|
322
|
+
-H "authorization: Bearer $IMAGE_SKILL_TOKEN"
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### `image-skill credits fake-purchase`
|
|
326
|
+
|
|
327
|
+
Confirms a previously returned fake/test quote and grants bounded
|
|
328
|
+
payment-backed credits in the hosted credit ledger. This command is deliberately
|
|
329
|
+
named `fake-purchase` because it is a harness-safe settlement precursor:
|
|
330
|
+
`live_money:false`, no live money moved, and no payment credential is accepted.
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
image-skill credits fake-purchase \
|
|
334
|
+
--quote-id quote_... \
|
|
335
|
+
--idempotency-key purchase-run-001 \
|
|
336
|
+
--json
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
`--idempotency-key` is required because the command mutates credit state even
|
|
340
|
+
though the settlement rail is fake/test-only.
|
|
341
|
+
|
|
342
|
+
Minimum success data:
|
|
343
|
+
|
|
344
|
+
```json
|
|
345
|
+
{
|
|
346
|
+
"state": "succeeded",
|
|
347
|
+
"quote_id": "quote_...",
|
|
348
|
+
"receipt_id": "receipt_...",
|
|
349
|
+
"credit_event_id": "credit_event_...",
|
|
350
|
+
"credits_granted": 10,
|
|
351
|
+
"amount_cents": 10,
|
|
352
|
+
"currency": "USD",
|
|
353
|
+
"accepted_payment_method": "fake",
|
|
354
|
+
"idempotency_key": "purchase-run-001",
|
|
355
|
+
"balance_after": 10,
|
|
356
|
+
"live_money": false
|
|
357
|
+
}
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
Hosted API equivalent:
|
|
361
|
+
|
|
362
|
+
```bash
|
|
363
|
+
curl -sS https://api.image-skill.com/v1/credit-purchases \
|
|
364
|
+
-H "authorization: Bearer $IMAGE_SKILL_TOKEN" \
|
|
365
|
+
-H "content-type: application/json" \
|
|
366
|
+
-d '{"quote_id":"quote_...","idempotency_key":"purchase-run-001"}'
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
Do not pass card data, wallet secrets, provider receipts, Stripe secrets, MPP
|
|
370
|
+
tokens, SPTs, or any payment credential to credits commands. Stripe Checkout
|
|
371
|
+
collects payment details only on Stripe-hosted pages. The public request fields
|
|
372
|
+
are `credits`, `pack_id`, `payment_method`, `quote_id`, status reference IDs,
|
|
373
|
+
and `idempotency_key`.
|
|
374
|
+
|
|
375
|
+
### `image-skill models`
|
|
376
|
+
|
|
377
|
+
First-run creative discovery. Lists public models and shows the full
|
|
378
|
+
capability-preserving schema for one model.
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
image-skill models --json
|
|
382
|
+
image-skill models list --json
|
|
383
|
+
image-skill models show MODEL_ID --json
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
Hosted API equivalents:
|
|
387
|
+
|
|
388
|
+
```bash
|
|
389
|
+
curl -sS https://api.image-skill.com/v1/models
|
|
390
|
+
curl -sS https://api.image-skill.com/v1/models/xai.grok-imagine-image
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
`models show` exposes operation support, media input/output types, parameter
|
|
394
|
+
schemas, defaults and fixed controls, cost and latency class, safety behavior,
|
|
395
|
+
and migration hints. Agents should inspect it before assuming a model supports
|
|
396
|
+
seeds, masks, reference images, transparent backgrounds, arbitrary aspect
|
|
397
|
+
ratios, image-size presets, output counts, resolution controls, safety
|
|
398
|
+
controls, or provider-native options.
|
|
399
|
+
|
|
400
|
+
Image Skill standardizes common controls so agents can work quickly, but it
|
|
401
|
+
must not flatten rich model capabilities into coarse universal categories.
|
|
402
|
+
Use `model_parameters` for rare or model-specific parameters advertised by the
|
|
403
|
+
capability schema.
|
|
404
|
+
|
|
405
|
+
GPT Image 2 is exposed as `openai.gpt-image-2` for create and
|
|
406
|
+
`openai.gpt-image-2-edit` for edit when OpenAI is configured. Inspect these
|
|
407
|
+
models before use; OpenAI provider-native controls such as size, output
|
|
408
|
+
format, compression, background, moderation, and the upstream
|
|
409
|
+
provider-native quality parameter are available only through validated
|
|
410
|
+
`model_parameters`.
|
|
411
|
+
|
|
412
|
+
### `image-skill capabilities`
|
|
413
|
+
|
|
414
|
+
Schema-language view over the same capability catalog. Use this when you need
|
|
415
|
+
the capability abstraction directly rather than starting from a model.
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
image-skill capabilities --json
|
|
419
|
+
image-skill capabilities list --json
|
|
420
|
+
image-skill capabilities show CAPABILITY_ID --json
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### `image-skill create`
|
|
424
|
+
|
|
425
|
+
Creates an image or plans a zero-cost dry run.
|
|
426
|
+
|
|
427
|
+
```bash
|
|
428
|
+
image-skill create \
|
|
429
|
+
--prompt "A compact field camera on a stainless workbench" \
|
|
430
|
+
--intent explore \
|
|
431
|
+
--aspect-ratio 1:1 \
|
|
432
|
+
--max-estimated-usd-per-image 0.05 \
|
|
433
|
+
--json
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
Preview-compatible richer shape:
|
|
437
|
+
|
|
438
|
+
```bash
|
|
439
|
+
image-skill create \
|
|
440
|
+
--prompt-file ./prompt.md \
|
|
441
|
+
--intent finalize \
|
|
442
|
+
--model MODEL_ID \
|
|
443
|
+
--aspect-ratio 1:1 \
|
|
444
|
+
--format png \
|
|
445
|
+
--max-usd 0.25 \
|
|
446
|
+
--model-parameters-json '{"seed":1234}' \
|
|
447
|
+
--json
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
`model_parameters` must be validated against the selected model/capability
|
|
451
|
+
schema before any provider call or paid reservation. Unknown fields fail closed
|
|
452
|
+
unless the capability explicitly allows additional properties. This is how
|
|
453
|
+
Image Skill preserves rare model controls without turning every
|
|
454
|
+
provider-specific parameter into a top-level flag.
|
|
455
|
+
In the current preview, Fal create/edit expose executable `seed`, and OpenAI
|
|
456
|
+
GPT Image 2 exposes documented provider-native controls through
|
|
457
|
+
`model_parameters`. Provider-native controls remain visible for planning and
|
|
458
|
+
fail closed until their capability schema marks them executable.
|
|
459
|
+
|
|
460
|
+
Minimum success data:
|
|
461
|
+
|
|
462
|
+
```json
|
|
463
|
+
{
|
|
464
|
+
"job_id": "job_...",
|
|
465
|
+
"capability": {
|
|
466
|
+
"id": "is.image.generate.preview.v1"
|
|
467
|
+
},
|
|
468
|
+
"assets": [
|
|
469
|
+
{
|
|
470
|
+
"asset_id": "image_...",
|
|
471
|
+
"path": "https://media.image-skill.com/a/image_abc123.png",
|
|
472
|
+
"mime_type": "image/png",
|
|
473
|
+
"url": "https://media.image-skill.com/a/image_abc123.png"
|
|
474
|
+
}
|
|
475
|
+
],
|
|
476
|
+
"cost": {
|
|
477
|
+
"estimated_usd": 0.025,
|
|
478
|
+
"credit_pricing": {
|
|
479
|
+
"credit_unit_usd": 0.01,
|
|
480
|
+
"credits_required": 5,
|
|
481
|
+
"estimated_provider_cost_usd": 0.025,
|
|
482
|
+
"estimated_revenue_usd": 0.05,
|
|
483
|
+
"pricing_confidence": "known"
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
"safety": {
|
|
487
|
+
"status": "allowed"
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
When hosted artifact storage is configured, `url` is an Image Skill-owned URL.
|
|
493
|
+
Agents should prefer `assets[].url` over provider-origin URLs and should not
|
|
494
|
+
need provider account access to fetch outputs.
|
|
495
|
+
|
|
496
|
+
Hosted create does not accept `--output-dir`. A future download/fetch command
|
|
497
|
+
may add CLI-side local file convenience while preserving hosted artifact URLs as
|
|
498
|
+
the source of truth.
|
|
499
|
+
|
|
500
|
+
If provider generation succeeds but artifact storage fails, the command returns
|
|
501
|
+
`ARTIFACT_STORAGE_WRITE_FAILED` with exit `9` and `retryable: false`. Agents
|
|
502
|
+
should not retry the whole create blindly, because that may duplicate paid
|
|
503
|
+
provider spend.
|
|
504
|
+
|
|
505
|
+
Hosted free-preview API equivalent:
|
|
506
|
+
|
|
507
|
+
```bash
|
|
508
|
+
curl -sS https://api.image-skill.com/v1/create \
|
|
509
|
+
-H "authorization: Bearer $IMAGE_SKILL_TOKEN" \
|
|
510
|
+
-H "content-type: application/json" \
|
|
511
|
+
-d '{
|
|
512
|
+
"prompt": "A compact field camera on a stainless workbench",
|
|
513
|
+
"intent": "explore",
|
|
514
|
+
"aspect_ratio": "1:1",
|
|
515
|
+
"max_estimated_usd_per_image": 0.05,
|
|
516
|
+
"model_parameters": {
|
|
517
|
+
"seed": 1234
|
|
518
|
+
}
|
|
519
|
+
}'
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
Hosted free-preview create currently requires owned artifact storage and returns
|
|
523
|
+
`assets[].url` under `https://media.image-skill.com/...` on success.
|
|
524
|
+
|
|
525
|
+
### `image-skill upload`
|
|
526
|
+
|
|
527
|
+
Normalizes a local image path or remote image URL into an Image Skill-owned
|
|
528
|
+
input asset for later edit workflows.
|
|
529
|
+
|
|
530
|
+
```bash
|
|
531
|
+
image-skill upload ./source.png --json
|
|
532
|
+
image-skill upload https://example.com/source.png --json
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
The CLI reads local files and remote URLs client-side, then sends image bytes to
|
|
536
|
+
`POST /v1/upload`. The hosted API does not fetch arbitrary remote URLs in this
|
|
537
|
+
preview. This keeps server-side URL fetching out of the public upload path.
|
|
538
|
+
|
|
539
|
+
Minimum success data:
|
|
540
|
+
|
|
541
|
+
```json
|
|
542
|
+
{
|
|
543
|
+
"request": {
|
|
544
|
+
"source_kind": "local_path",
|
|
545
|
+
"filename": "source.png",
|
|
546
|
+
"remote_origin": null
|
|
547
|
+
},
|
|
548
|
+
"asset": {
|
|
549
|
+
"asset_id": "image_...",
|
|
550
|
+
"job_id": "job_...",
|
|
551
|
+
"kind": "uploaded",
|
|
552
|
+
"url": "https://media.image-skill.com/a/image_abc123.png",
|
|
553
|
+
"mime_type": "image/png",
|
|
554
|
+
"content_length": 12345
|
|
555
|
+
},
|
|
556
|
+
"upload": {
|
|
557
|
+
"bytes": 12345,
|
|
558
|
+
"mime_type": "image/png",
|
|
559
|
+
"sha256": "...",
|
|
560
|
+
"policy": {
|
|
561
|
+
"status": "allowed"
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
Supported preview MIME types are `image/png`, `image/jpeg`, `image/webp`,
|
|
568
|
+
`image/gif`, and `image/avif`. Unsupported input returns
|
|
569
|
+
`INPUT_POLICY_DENIED` with exit `6`. Responses never include local paths, raw
|
|
570
|
+
bytes, base64 payloads, full remote URLs, bucket names, or object keys.
|
|
571
|
+
|
|
572
|
+
### `image-skill edit`
|
|
573
|
+
|
|
574
|
+
Edits an Image Skill-owned input asset or client-normalized local/remote image
|
|
575
|
+
with one hosted provider-backed edit model.
|
|
576
|
+
|
|
577
|
+
```bash
|
|
578
|
+
image-skill edit \
|
|
579
|
+
--input ASSET_ID_OR_PATH_OR_URL \
|
|
580
|
+
--prompt "Remove the background and keep natural object shadows" \
|
|
581
|
+
--accept-unknown-cost \
|
|
582
|
+
--json
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
If `--input` is a local path or external URL, the public CLI first normalizes it
|
|
586
|
+
through the same upload resolver as `image-skill upload`, then sends only the
|
|
587
|
+
resulting `asset_id` to `POST /v1/edit`. If `--input` is an Image Skill asset id
|
|
588
|
+
or owned asset URL, edit uses that owned asset directly.
|
|
589
|
+
|
|
590
|
+
Preview hosted edit supports model-specific provider-backed edit paths such as
|
|
591
|
+
Fal Nano Banana 2 Edit (`fal.nano-banana-2-edit`) and GPT Image 2 Edit
|
|
592
|
+
(`openai.gpt-image-2-edit`) when their provider credentials are configured.
|
|
593
|
+
Current machine-readable prices are treated as unknown for these edit paths, so
|
|
594
|
+
live edit requires `--accept-unknown-cost` until a stable price source is
|
|
595
|
+
captured. Responses include a new generated asset URL, job id, safety state,
|
|
596
|
+
quota consumption, and input asset metadata. Responses do not include raw
|
|
597
|
+
prompts, source bytes, base64 payloads, local paths, full external URLs, bucket
|
|
598
|
+
names, or object keys.
|
|
599
|
+
|
|
600
|
+
Provider/model names in this paragraph are preview provenance, not the primary
|
|
601
|
+
public UX. The public selection surface should be Image Skill capabilities and
|
|
602
|
+
model-parameter schemas; provider/model details belong in explicit
|
|
603
|
+
provenance/debug output.
|
|
604
|
+
|
|
605
|
+
### `image-skill assets show`
|
|
606
|
+
|
|
607
|
+
Inspects an Image Skill-owned asset URL or hosted asset id.
|
|
608
|
+
|
|
609
|
+
```bash
|
|
610
|
+
image-skill assets show \
|
|
611
|
+
https://media.image-skill.com/a/image_abc123.png \
|
|
612
|
+
--json
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
For asset-id lookup, use hosted auth:
|
|
616
|
+
|
|
617
|
+
```bash
|
|
618
|
+
image-skill assets show image_... --json
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
Minimum success data:
|
|
622
|
+
|
|
623
|
+
```json
|
|
624
|
+
{
|
|
625
|
+
"request": {
|
|
626
|
+
"reference": "image_...",
|
|
627
|
+
"reference_type": "asset_id"
|
|
628
|
+
},
|
|
629
|
+
"asset": {
|
|
630
|
+
"asset_id": "image_...",
|
|
631
|
+
"job_id": "job_...",
|
|
632
|
+
"url": "https://media.image-skill.com/a/image_abc123.png",
|
|
633
|
+
"mime_type": "image/png",
|
|
634
|
+
"content_length": 12345,
|
|
635
|
+
"width": 1024,
|
|
636
|
+
"height": 1024,
|
|
637
|
+
"source": "hosted_metadata"
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
External URLs are rejected. Older assets created before hosted asset metadata
|
|
643
|
+
was recorded may still be inspectable by Image Skill-owned URL.
|
|
644
|
+
|
|
645
|
+
### `image-skill assets get`
|
|
646
|
+
|
|
647
|
+
Downloads an Image Skill-owned asset URL or hosted asset id to a local file.
|
|
648
|
+
|
|
649
|
+
```bash
|
|
650
|
+
image-skill assets get \
|
|
651
|
+
https://media.image-skill.com/a/image_abc123.png \
|
|
652
|
+
--output ./result.png \
|
|
653
|
+
--json
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
The command refuses to overwrite existing files unless `--overwrite` is
|
|
657
|
+
explicit. It verifies byte length when the asset server provides a
|
|
658
|
+
`content-length` header.
|
|
659
|
+
|
|
660
|
+
### `image-skill jobs show`
|
|
661
|
+
|
|
662
|
+
Inspects a hosted Image Skill job visible to the authenticated agent.
|
|
663
|
+
|
|
664
|
+
```bash
|
|
665
|
+
image-skill jobs show job_... --json
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
Output includes public job status, trace id, timestamps, capability id, cost
|
|
669
|
+
summary, safety status, and Image Skill-owned asset metadata. Provider/model
|
|
670
|
+
provenance is available only through explicit provenance/debug affordances for
|
|
671
|
+
authorized actors. Default output does not include raw prompts, generated bytes, provider
|
|
672
|
+
credentials, DB/storage keys, bucket names, or local paths.
|
|
673
|
+
|
|
674
|
+
### `image-skill jobs wait`
|
|
675
|
+
|
|
676
|
+
Waits for a hosted Image Skill job to reach a terminal status.
|
|
677
|
+
|
|
678
|
+
```bash
|
|
679
|
+
image-skill jobs wait job_... --timeout-ms 30000 --poll-interval-ms 1000 --json
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
Completed jobs return immediately. Non-terminal jobs poll until completion,
|
|
683
|
+
failure, cancellation, or deterministic timeout.
|
|
684
|
+
|
|
685
|
+
### `image-skill activity list`
|
|
686
|
+
|
|
687
|
+
Lists recent hosted activity ledger events visible to the authenticated agent.
|
|
688
|
+
|
|
689
|
+
```bash
|
|
690
|
+
image-skill activity list --limit 20 --json
|
|
691
|
+
image-skill activity list --subject job_... --json
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
Activity is the ledger, not the work queue. Use it to find recent event IDs,
|
|
695
|
+
related job IDs, asset IDs, usage IDs, feedback IDs, trace IDs, status changes,
|
|
696
|
+
and product-memory writes. Use `jobs show` or `jobs wait` when you need
|
|
697
|
+
operational recovery, polling, retry judgment, or final job assets.
|
|
698
|
+
|
|
699
|
+
Minimum success data:
|
|
700
|
+
|
|
701
|
+
```json
|
|
702
|
+
{
|
|
703
|
+
"events": [
|
|
704
|
+
{
|
|
705
|
+
"event_id": "evt_...",
|
|
706
|
+
"type": "job.completed",
|
|
707
|
+
"occurred_at": "2026-05-05T19:00:23.000Z",
|
|
708
|
+
"summary": "Create job completed",
|
|
709
|
+
"operation": "create",
|
|
710
|
+
"subject": {
|
|
711
|
+
"type": "job",
|
|
712
|
+
"id": "job_..."
|
|
713
|
+
},
|
|
714
|
+
"links": {
|
|
715
|
+
"job_id": "job_...",
|
|
716
|
+
"asset_ids": ["image_..."],
|
|
717
|
+
"feedback_id": null,
|
|
718
|
+
"usage_event_id": "usage_..."
|
|
719
|
+
},
|
|
720
|
+
"status": "completed",
|
|
721
|
+
"cost": {
|
|
722
|
+
"estimated_usd": 0.025
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
],
|
|
726
|
+
"source": "hosted_activity_ledger"
|
|
727
|
+
}
|
|
728
|
+
```
|
|
729
|
+
|
|
730
|
+
The ledger hides provider and storage implementation details by default. It is
|
|
731
|
+
safe to cite `evt_...`, `job_...`, `image_...`, `usage_...`, `feedback_id`,
|
|
732
|
+
and `trace_id` values in feedback.
|
|
733
|
+
|
|
734
|
+
Hosted API equivalent:
|
|
735
|
+
|
|
736
|
+
```bash
|
|
737
|
+
curl -sS "https://api.image-skill.com/v1/activity?limit=20&subject=job_..." \
|
|
738
|
+
-H "authorization: Bearer $IMAGE_SKILL_TOKEN"
|
|
739
|
+
```
|
|
740
|
+
|
|
741
|
+
### `image-skill activity show`
|
|
742
|
+
|
|
743
|
+
Shows one hosted activity event or the latest events related to one subject.
|
|
744
|
+
|
|
745
|
+
```bash
|
|
746
|
+
image-skill activity show evt_... --json
|
|
747
|
+
image-skill activity show job_... --json
|
|
748
|
+
image-skill activity show image_... --json
|
|
749
|
+
image-skill activity show sig_... --json
|
|
750
|
+
```
|
|
751
|
+
|
|
752
|
+
`activity show` accepts activity event IDs plus job, asset, usage, feedback, and
|
|
753
|
+
trace references. When the reference is a subject rather than one exact event,
|
|
754
|
+
the response includes matching ledger events so an agent can cite the right
|
|
755
|
+
event without reading telemetry logs.
|
|
756
|
+
|
|
757
|
+
Hosted API equivalent:
|
|
758
|
+
|
|
759
|
+
```bash
|
|
760
|
+
curl -sS https://api.image-skill.com/v1/activity/evt_... \
|
|
761
|
+
-H "authorization: Bearer $IMAGE_SKILL_TOKEN"
|
|
762
|
+
```
|
|
763
|
+
|
|
764
|
+
### Activity Event Registry
|
|
765
|
+
|
|
766
|
+
Activity `type` values are stable public contract values. Do not infer new
|
|
767
|
+
event names from provider responses or telemetry logs; use only the registry
|
|
768
|
+
below.
|
|
769
|
+
|
|
770
|
+
| Event type | Subject | Operation | Emitted when | Stable links |
|
|
771
|
+
| ---------------------------------- | ---------- | ----------- | ---------------------------------------------------------------- | ------------------------------------------------------- |
|
|
772
|
+
| `job.completed` | `job` | create/edit | A hosted create or edit job reaches a terminal state. | `job_id`, `asset_ids`, `usage_event_id` |
|
|
773
|
+
| `asset.created` | `asset` | create/edit | A hosted create or edit produces an output asset. | `job_id`, `asset_ids`, `usage_event_id` |
|
|
774
|
+
| `asset.uploaded` | `asset` | upload | A public edit workflow uploads or imports input media. | `job_id`, `asset_ids`, `usage_event_id` |
|
|
775
|
+
| `usage.credit_consumed` | `usage` | usage | A creative operation records a preview-credit entry. | `job_id`, `usage_event_id` |
|
|
776
|
+
| `feedback.created` | `feedback` | feedback | Hosted agent feedback is accepted into product memory. | `feedback_id` |
|
|
777
|
+
| `payment.checkout_session.created` | `payment` | payment | A Stripe Checkout session is created and awaits external action. | `quote_id`, `payment_attempt_id`, `checkout_session_id` |
|
|
778
|
+
| `credits.payment_backed_granted` | `credit` | credits | Verified payment or fake-payment proof grants paid credits. | `quote_id`, `receipt_id`, `credit_event_id` |
|
|
779
|
+
|
|
780
|
+
If a response includes an event type outside this registry, treat it as a
|
|
781
|
+
contract bug and submit `image-skill feedback create --json` with the event ID
|
|
782
|
+
and trace ID.
|
|
783
|
+
|
|
784
|
+
### `image-skill feedback create`
|
|
785
|
+
|
|
786
|
+
Leaves structured product feedback in hosted Image Skill product memory.
|
|
787
|
+
At minimum, provide `--title` and `--body`; Image Skill accepts narrative
|
|
788
|
+
feedback and adds quality guidance server-side. Use the structured fields below
|
|
789
|
+
when the agent already knows them.
|
|
790
|
+
|
|
791
|
+
```bash
|
|
792
|
+
image-skill feedback create \
|
|
793
|
+
--type user_feedback \
|
|
794
|
+
--title "Short concrete title" \
|
|
795
|
+
--body "What happened, what was expected, and why it matters" \
|
|
796
|
+
--command "Command or workflow observed" \
|
|
797
|
+
--expected "Expected result" \
|
|
798
|
+
--actual "Actual result" \
|
|
799
|
+
--proof-needed "What would prove this is handled" \
|
|
800
|
+
--surface cli,docs \
|
|
801
|
+
--evidence trace:TRACE_ID \
|
|
802
|
+
--severity medium \
|
|
803
|
+
--confidence high \
|
|
804
|
+
--next-state watch \
|
|
805
|
+
--json
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
Hosted feedback requires `IMAGE_SKILL_TOKEN` and persists through
|
|
809
|
+
`https://api.image-skill.com/v1/feedback`. The hosted API fails closed if
|
|
810
|
+
durable hosted feedback storage is unavailable.
|
|
811
|
+
|
|
812
|
+
JSON errors may include `error.recovery` with machine-readable fields such as
|
|
813
|
+
`required_flag`, `suggested_command`, `docs_url`, or `retry_after_seconds`.
|
|
814
|
+
Agents should prefer those fields over parsing prose error messages. For
|
|
815
|
+
example, `BUDGET_REQUIRES_CONFIRMATION` returns
|
|
816
|
+
`required_flag: "--accept-unknown-cost"`.
|
|
817
|
+
|
|
818
|
+
`whoami`, `usage quota`, `quota`, `credits quote`, `credits buy`,
|
|
819
|
+
`credits status`, `credits fake-purchase`, `create`, `activity list`,
|
|
820
|
+
`activity show`, and `feedback create` accept `--token-stdin` for stdin-based
|
|
821
|
+
secret handoff.
|
|
822
|
+
`credits packs list` does not require auth.
|
|
823
|
+
|
|
824
|
+
Feedback should avoid raw prompts, provider keys, generated image bytes, source
|
|
825
|
+
image bytes, and private user data.
|
|
826
|
+
|
|
827
|
+
Hosted API equivalent:
|
|
828
|
+
|
|
829
|
+
```bash
|
|
830
|
+
curl -sS https://api.image-skill.com/v1/feedback \
|
|
831
|
+
-H "authorization: Bearer $IMAGE_SKILL_TOKEN" \
|
|
832
|
+
-H "content-type: application/json" \
|
|
833
|
+
-d '{
|
|
834
|
+
"type": "user_feedback",
|
|
835
|
+
"title": "Short concrete title",
|
|
836
|
+
"body": "What happened, what was expected, and why it matters",
|
|
837
|
+
"command": "Command or workflow observed",
|
|
838
|
+
"expected": "Expected result",
|
|
839
|
+
"actual": "Actual result",
|
|
840
|
+
"proof_needed": "What would prove this is handled",
|
|
841
|
+
"surface": ["cli", "docs"],
|
|
842
|
+
"evidence": ["trace:TRACE_ID"],
|
|
843
|
+
"severity": "medium",
|
|
844
|
+
"confidence": "high",
|
|
845
|
+
"next_state": "watch"
|
|
846
|
+
}'
|
|
847
|
+
```
|
|
848
|
+
|
|
849
|
+
### Planned Resource Commands
|
|
850
|
+
|
|
851
|
+
`jobs list`, `assets list`, `assets delete`, and async job cancellation are
|
|
852
|
+
planned public resource commands. They are not part of the current public
|
|
853
|
+
allowlist until the hosted service backs them and this contract lists their
|
|
854
|
+
exact command shapes. `activity list/show` is available now for ledger
|
|
855
|
+
readback, but it is not a substitute for future job listing, cancellation, or
|
|
856
|
+
retry controls.
|