image-skill 0.1.20 → 0.1.22
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/CHANGELOG.md +24 -0
- package/bin/image-skill.mjs +152 -10
- package/cli.md +142 -32
- package/llms.txt +12 -11
- package/package.json +1 -1
- package/skill.md +69 -29
- package/skills/image-skill/SKILL.md +69 -29
- package/skills/image-skill/references/cli.md +142 -32
- package/skills/image-skill/references/llms.txt +12 -11
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,30 @@ This changelog tracks the public `image-skill` CLI package and public skill
|
|
|
4
4
|
mirror. The npm package metadata remains the authority for tarball integrity and
|
|
5
5
|
provenance; this file is the human- and agent-readable release map.
|
|
6
6
|
|
|
7
|
+
## 0.1.22 - 2026-06-02
|
|
8
|
+
|
|
9
|
+
- Fix (guide): `create --guide` now reports `cost.estimated_usd_per_image` as
|
|
10
|
+
the actual Image Skill credit debit dollars, matching `estimated_credits`.
|
|
11
|
+
The guide still exposes the upstream provider estimate separately as
|
|
12
|
+
`estimated_provider_usd_per_image`, so agents no longer see a confusing
|
|
13
|
+
"17 credits but $0.10" first-run cost mismatch.
|
|
14
|
+
- Fix (payment discovery): `credits methods --json` and
|
|
15
|
+
`credits packs list --json` now tolerate `--token` / `--token-stdin`.
|
|
16
|
+
Fresh agents that safely carry their signup token through stdin can inspect
|
|
17
|
+
payment rails without hitting an unsupported-flag dead end; the token is
|
|
18
|
+
drained and not forwarded to the no-auth discovery endpoint.
|
|
19
|
+
|
|
20
|
+
## 0.1.21 - 2026-06-02
|
|
21
|
+
|
|
22
|
+
- Release: ships the guide auth handoff already present on main to
|
|
23
|
+
`image-skill@latest`. Fresh agents that run `create --guide` now receive
|
|
24
|
+
`data.auth_handoff` templates in `auth_required` and `ready_to_create`, so a
|
|
25
|
+
one-time hosted signup token can be carried through `IMAGE_SKILL_TOKEN` or
|
|
26
|
+
`--token-stdin` without leaking it or falling back to URL installs.
|
|
27
|
+
- Test: keeps the public trust-packet fixture aligned with the new npm version
|
|
28
|
+
so the release guard verifies the package, provenance, and CLI version as one
|
|
29
|
+
contract.
|
|
30
|
+
|
|
7
31
|
## 0.1.20 - 2026-06-02
|
|
8
32
|
|
|
9
33
|
- Fix (funnel): the advertised `signup` usage line omitted the now-required
|
package/bin/image-skill.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { Readable } from "node:stream";
|
|
|
7
7
|
import { pipeline } from "node:stream/promises";
|
|
8
8
|
import os from "node:os";
|
|
9
9
|
|
|
10
|
-
const VERSION = "0.1.
|
|
10
|
+
const VERSION = "0.1.22";
|
|
11
11
|
const PACKAGE_NAME = "image-skill";
|
|
12
12
|
const DEFAULT_API_BASE_URL = "https://api.image-skill.com";
|
|
13
13
|
const DEFAULT_DOCS_BASE_URL = "https://image-skill.com";
|
|
@@ -32,6 +32,7 @@ const SIGNUP_SUGGESTED_COMMAND =
|
|
|
32
32
|
const SIGNUP_CONTACT_GUIDANCE =
|
|
33
33
|
"Preview signup currently requires an email-shaped durable contact inbox, not an individual human email. Use an agent-owned inbox when available; otherwise use an operator, team, or sponsor inbox that can receive future claim, billing, or abuse notices. Do not block waiting for a person, invent a person, or use a throwaway inbox. --human-email remains a compatibility alias.";
|
|
34
34
|
const PUBLIC_NPX_COMMAND_PREFIX = "npx -y image-skill@latest";
|
|
35
|
+
const CREDIT_UNIT_USD = 0.01;
|
|
35
36
|
const PAYMENT_CREDENTIAL_FLAGS = new Set([
|
|
36
37
|
"payment-token",
|
|
37
38
|
"payment-secret",
|
|
@@ -547,7 +548,8 @@ async function credits(argv) {
|
|
|
547
548
|
if (subcommand === "methods") {
|
|
548
549
|
const args = parseArgs(rest);
|
|
549
550
|
const unknownFlags = [...args.flags.keys()].filter(
|
|
550
|
-
(flag) =>
|
|
551
|
+
(flag) =>
|
|
552
|
+
!["json", "api-base-url", "token", "token-stdin"].includes(flag),
|
|
551
553
|
);
|
|
552
554
|
if (!flagBool(args, "json")) {
|
|
553
555
|
return invalid(
|
|
@@ -563,6 +565,13 @@ async function credits(argv) {
|
|
|
563
565
|
: "credits methods does not accept positional arguments",
|
|
564
566
|
);
|
|
565
567
|
}
|
|
568
|
+
const tokenHandoff = await acceptNoAuthTokenHandoff(
|
|
569
|
+
args,
|
|
570
|
+
"image-skill credits methods",
|
|
571
|
+
);
|
|
572
|
+
if (tokenHandoff !== null) {
|
|
573
|
+
return tokenHandoff;
|
|
574
|
+
}
|
|
566
575
|
return apiRequest({
|
|
567
576
|
command: "image-skill credits methods",
|
|
568
577
|
method: "GET",
|
|
@@ -579,6 +588,25 @@ async function credits(argv) {
|
|
|
579
588
|
);
|
|
580
589
|
}
|
|
581
590
|
const args = parseArgs(packsRest);
|
|
591
|
+
const unknownFlags = [...args.flags.keys()].filter(
|
|
592
|
+
(flag) =>
|
|
593
|
+
!["json", "api-base-url", "token", "token-stdin"].includes(flag),
|
|
594
|
+
);
|
|
595
|
+
if (args.positionals.length > 0 || unknownFlags.length > 0) {
|
|
596
|
+
return invalid(
|
|
597
|
+
"image-skill credits packs list",
|
|
598
|
+
unknownFlags.length > 0
|
|
599
|
+
? `unsupported flags for credits packs list: ${unknownFlags.map((flag) => `--${flag}`).join(", ")}`
|
|
600
|
+
: "credits packs list does not accept positional arguments",
|
|
601
|
+
);
|
|
602
|
+
}
|
|
603
|
+
const tokenHandoff = await acceptNoAuthTokenHandoff(
|
|
604
|
+
args,
|
|
605
|
+
"image-skill credits packs list",
|
|
606
|
+
);
|
|
607
|
+
if (tokenHandoff !== null) {
|
|
608
|
+
return tokenHandoff;
|
|
609
|
+
}
|
|
582
610
|
return apiRequest({
|
|
583
611
|
command: "image-skill credits packs list",
|
|
584
612
|
method: "GET",
|
|
@@ -719,6 +747,33 @@ async function credits(argv) {
|
|
|
719
747
|
);
|
|
720
748
|
}
|
|
721
749
|
|
|
750
|
+
async function acceptNoAuthTokenHandoff(args, command) {
|
|
751
|
+
const tokenValues = args.flags.get("token");
|
|
752
|
+
if (tokenValues !== undefined && typeof tokenValues.at(-1) !== "string") {
|
|
753
|
+
return invalid(command, "token requires a value");
|
|
754
|
+
}
|
|
755
|
+
if (flagBool(args, "token-stdin") && tokenValues !== undefined) {
|
|
756
|
+
return invalid(command, "use either --token or --token-stdin, not both");
|
|
757
|
+
}
|
|
758
|
+
if (!flagBool(args, "token-stdin")) {
|
|
759
|
+
return null;
|
|
760
|
+
}
|
|
761
|
+
if (process.stdin.isTTY) {
|
|
762
|
+
return invalid(command, "--token-stdin requires a token piped on stdin");
|
|
763
|
+
}
|
|
764
|
+
const token = (await readStdin()).trim();
|
|
765
|
+
if (token.length === 0) {
|
|
766
|
+
return failure(
|
|
767
|
+
command,
|
|
768
|
+
3,
|
|
769
|
+
"AUTH_REQUIRED",
|
|
770
|
+
"--token-stdin received empty stdin",
|
|
771
|
+
false,
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
return null;
|
|
775
|
+
}
|
|
776
|
+
|
|
722
777
|
async function models(argv) {
|
|
723
778
|
const [subcommand, ...rest] = argv;
|
|
724
779
|
const args = parseArgs(
|
|
@@ -863,6 +918,10 @@ async function createGuide(args) {
|
|
|
863
918
|
const requestedModelId = flagString(args, "model");
|
|
864
919
|
const requestedProviderId = flagString(args, "provider");
|
|
865
920
|
const requestedIntent = flagString(args, "intent") ?? "explore";
|
|
921
|
+
const maxEstimatedUsdPerImage = flagNumber(
|
|
922
|
+
args,
|
|
923
|
+
"max-estimated-usd-per-image",
|
|
924
|
+
);
|
|
866
925
|
const health = await apiRequest({
|
|
867
926
|
command: "image-skill create --guide",
|
|
868
927
|
method: "GET",
|
|
@@ -888,16 +947,22 @@ async function createGuide(args) {
|
|
|
888
947
|
|
|
889
948
|
const selected =
|
|
890
949
|
models.envelope.ok && models.envelope.data?.models
|
|
891
|
-
? selectCreateGuideModel(models.envelope.data.models, requestedModelId
|
|
950
|
+
? selectCreateGuideModel(models.envelope.data.models, requestedModelId, {
|
|
951
|
+
maxEstimatedUsdPerImage,
|
|
952
|
+
})
|
|
892
953
|
: null;
|
|
893
954
|
const pricing = selected?.economics?.credit_pricing ?? null;
|
|
894
955
|
const estimatedCredits = pricing?.credits_required ?? null;
|
|
895
|
-
const
|
|
956
|
+
const estimatedProviderUsdPerImage =
|
|
896
957
|
selected?.economics?.estimated_usd_per_image ??
|
|
897
|
-
|
|
958
|
+
pricing?.estimated_provider_cost_usd ??
|
|
959
|
+
pricing?.fallback_provider_cost_usd ??
|
|
960
|
+
null;
|
|
961
|
+
const estimatedDebitUsdPerImage =
|
|
962
|
+
pricing?.estimated_revenue_usd ?? estimatedProviderUsdPerImage;
|
|
898
963
|
const budgetGuard =
|
|
899
|
-
|
|
900
|
-
|
|
964
|
+
maxEstimatedUsdPerImage ??
|
|
965
|
+
estimatedDebitUsdPerImage ??
|
|
901
966
|
(estimatedCredits === null ? 0.07 : estimatedCredits / 100);
|
|
902
967
|
const quota =
|
|
903
968
|
token.token === null
|
|
@@ -942,6 +1007,11 @@ async function createGuide(args) {
|
|
|
942
1007
|
PUBLIC_NPX_COMMAND_PREFIX,
|
|
943
1008
|
)
|
|
944
1009
|
: null;
|
|
1010
|
+
const authHandoff = createGuideAuthHandoff(stage, {
|
|
1011
|
+
tokenSource: token.source,
|
|
1012
|
+
nextCommand,
|
|
1013
|
+
afterNext,
|
|
1014
|
+
});
|
|
945
1015
|
return success("image-skill create --guide", {
|
|
946
1016
|
schema: "image-skill.create-guide.v1",
|
|
947
1017
|
ready: stage === "ready_to_create",
|
|
@@ -998,12 +1068,16 @@ async function createGuide(args) {
|
|
|
998
1068
|
},
|
|
999
1069
|
cost: {
|
|
1000
1070
|
estimated_credits: estimatedCredits,
|
|
1001
|
-
estimated_usd_per_image:
|
|
1071
|
+
estimated_usd_per_image: estimatedDebitUsdPerImage,
|
|
1072
|
+
estimated_debit_usd_per_image: estimatedDebitUsdPerImage,
|
|
1073
|
+
estimated_provider_usd_per_image: estimatedProviderUsdPerImage,
|
|
1074
|
+
credit_unit_usd: pricing?.credit_unit_usd ?? CREDIT_UNIT_USD,
|
|
1002
1075
|
pricing_confidence: pricing?.pricing_confidence ?? null,
|
|
1003
1076
|
},
|
|
1004
1077
|
blocker,
|
|
1005
1078
|
next_command: nextCommand,
|
|
1006
1079
|
after_next: afterNext,
|
|
1080
|
+
auth_handoff: authHandoff,
|
|
1007
1081
|
escape_hatches: {
|
|
1008
1082
|
doctor: renderGuidePrefixedCommand(
|
|
1009
1083
|
PUBLIC_NPX_COMMAND_PREFIX,
|
|
@@ -1055,7 +1129,11 @@ async function createGuide(args) {
|
|
|
1055
1129
|
});
|
|
1056
1130
|
}
|
|
1057
1131
|
|
|
1058
|
-
function selectCreateGuideModel(
|
|
1132
|
+
function selectCreateGuideModel(
|
|
1133
|
+
models,
|
|
1134
|
+
requestedModelId,
|
|
1135
|
+
{ maxEstimatedUsdPerImage = null } = {},
|
|
1136
|
+
) {
|
|
1059
1137
|
const isExecutableCreate = (model) =>
|
|
1060
1138
|
model?.status === "available" &&
|
|
1061
1139
|
model?.execution?.model_execution_status === "executable" &&
|
|
@@ -1067,7 +1145,26 @@ function selectCreateGuideModel(models, requestedModelId) {
|
|
|
1067
1145
|
? requested
|
|
1068
1146
|
: null;
|
|
1069
1147
|
}
|
|
1070
|
-
|
|
1148
|
+
const candidates = models.filter(isExecutableCreate);
|
|
1149
|
+
if (maxEstimatedUsdPerImage === null) {
|
|
1150
|
+
return candidates[0] ?? null;
|
|
1151
|
+
}
|
|
1152
|
+
const capped = candidates.filter((model) => {
|
|
1153
|
+
const estimatedUsd = guideBudgetUsdForModel(model);
|
|
1154
|
+
return estimatedUsd === null || estimatedUsd <= maxEstimatedUsdPerImage;
|
|
1155
|
+
});
|
|
1156
|
+
return (capped.length === 0 ? candidates : capped)[0] ?? null;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
function guideBudgetUsdForModel(model) {
|
|
1160
|
+
const pricing = model?.economics?.credit_pricing ?? null;
|
|
1161
|
+
return (
|
|
1162
|
+
pricing?.estimated_revenue_usd ??
|
|
1163
|
+
model?.economics?.estimated_usd_per_image ??
|
|
1164
|
+
pricing?.estimated_provider_cost_usd ??
|
|
1165
|
+
pricing?.fallback_provider_cost_usd ??
|
|
1166
|
+
null
|
|
1167
|
+
);
|
|
1071
1168
|
}
|
|
1072
1169
|
|
|
1073
1170
|
function createGuidePaymentSummary(data) {
|
|
@@ -1172,6 +1269,47 @@ function createGuideBlocker(stage, input) {
|
|
|
1172
1269
|
};
|
|
1173
1270
|
}
|
|
1174
1271
|
|
|
1272
|
+
function createGuideAuthHandoff(stage, input) {
|
|
1273
|
+
if (stage === "auth_required") {
|
|
1274
|
+
return {
|
|
1275
|
+
required: true,
|
|
1276
|
+
token_source: "none",
|
|
1277
|
+
secret_value_included: false,
|
|
1278
|
+
accepted_methods: ["IMAGE_SKILL_TOKEN", "--token-stdin", "config"],
|
|
1279
|
+
signup: {
|
|
1280
|
+
returns_token_once: true,
|
|
1281
|
+
public_cli_saves_config: false,
|
|
1282
|
+
store_token_in: "agent_runtime_secret_store",
|
|
1283
|
+
},
|
|
1284
|
+
rerun_guide:
|
|
1285
|
+
input.afterNext === null
|
|
1286
|
+
? null
|
|
1287
|
+
: {
|
|
1288
|
+
with_env: `IMAGE_SKILL_TOKEN="$IMAGE_SKILL_TOKEN" ${input.afterNext}`,
|
|
1289
|
+
with_stdin: renderTokenStdinCommand(input.afterNext),
|
|
1290
|
+
},
|
|
1291
|
+
next_command: null,
|
|
1292
|
+
};
|
|
1293
|
+
}
|
|
1294
|
+
if (stage === "ready_to_create") {
|
|
1295
|
+
return {
|
|
1296
|
+
required: true,
|
|
1297
|
+
token_source: input.tokenSource,
|
|
1298
|
+
secret_value_included: false,
|
|
1299
|
+
accepted_methods: ["IMAGE_SKILL_TOKEN", "--token-stdin", "config"],
|
|
1300
|
+
signup: null,
|
|
1301
|
+
rerun_guide: null,
|
|
1302
|
+
next_command: {
|
|
1303
|
+
requires_auth: true,
|
|
1304
|
+
reuse_current_auth_context: input.tokenSource,
|
|
1305
|
+
with_env: `IMAGE_SKILL_TOKEN="$IMAGE_SKILL_TOKEN" ${input.nextCommand}`,
|
|
1306
|
+
with_stdin: renderTokenStdinCommand(input.nextCommand),
|
|
1307
|
+
},
|
|
1308
|
+
};
|
|
1309
|
+
}
|
|
1310
|
+
return null;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1175
1313
|
function createGuideNextCommand(stage, input) {
|
|
1176
1314
|
if (stage === "prompt_required") {
|
|
1177
1315
|
return renderGuideCommand("PROMPT", input.apiBaseUrl, input.commandPrefix);
|
|
@@ -1220,6 +1358,10 @@ function renderGuideCommand(prompt, apiBaseUrl, commandPrefix = "image-skill") {
|
|
|
1220
1358
|
].join(" ");
|
|
1221
1359
|
}
|
|
1222
1360
|
|
|
1361
|
+
function renderTokenStdinCommand(command) {
|
|
1362
|
+
return `printf '%s\\n' "$IMAGE_SKILL_TOKEN" | ${command} --token-stdin`;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1223
1365
|
function renderCreateCommand(input) {
|
|
1224
1366
|
return [
|
|
1225
1367
|
input.commandPrefix ?? "image-skill",
|
package/cli.md
CHANGED
|
@@ -139,10 +139,16 @@ auth or payment state changes. Do not run `doctor`, `models list`, `signup`,
|
|
|
139
139
|
checklist before the guide asks for them.
|
|
140
140
|
|
|
141
141
|
- `prompt_required`: rerun `data.next_command` with the real prompt.
|
|
142
|
-
- `auth_required`: run `data.next_command`,
|
|
142
|
+
- `auth_required`: run `data.next_command`, store the returned token, then
|
|
143
|
+
rerun guide once. If the runtime does not automatically inject that token,
|
|
144
|
+
use `data.auth_handoff.rerun_guide.with_env` or
|
|
145
|
+
`data.auth_handoff.rerun_guide.with_stdin`.
|
|
143
146
|
- `quota_required`: follow the payment commands in
|
|
144
147
|
`data.checks.payments.suggested_commands`, then rerun guide once.
|
|
145
|
-
- `ready_to_create`: run `data.next_command` for the first bounded create.
|
|
148
|
+
- `ready_to_create`: run `data.next_command` for the first bounded create. If
|
|
149
|
+
the guide authenticated from env or stdin, prefer
|
|
150
|
+
`data.auth_handoff.next_command.with_env` or
|
|
151
|
+
`data.auth_handoff.next_command.with_stdin` so auth follows the create.
|
|
146
152
|
|
|
147
153
|
Manual escape hatches are not prerequisites. Use them only when
|
|
148
154
|
`data.next_command` / `data.escape_hatches` asks, or when the task genuinely
|
|
@@ -161,6 +167,9 @@ image-skill create --dry-run --prompt "a compact field camera on a stainless wor
|
|
|
161
167
|
Use `--show-token` for hosted signup only when the runtime can immediately store
|
|
162
168
|
the raw token once. For later commands, prefer `IMAGE_SKILL_TOKEN` or
|
|
163
169
|
`--token-stdin`; both keep tokens out of prompts and shell history.
|
|
170
|
+
`create --guide` also returns `data.auth_handoff` with copy-safe env/stdin
|
|
171
|
+
templates when auth is required or when the returned create command needs the
|
|
172
|
+
same auth context.
|
|
164
173
|
|
|
165
174
|
### Local Config And Install
|
|
166
175
|
|
|
@@ -257,15 +266,28 @@ Minimum success data shape:
|
|
|
257
266
|
"requires_browser": true,
|
|
258
267
|
"default_pack_id": "starter-500",
|
|
259
268
|
"purchase_endpoint": "/v1/credit-purchases/stripe-checkout-sessions"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"method_id": "stripe_x402.exact.usdc",
|
|
272
|
+
"status": "available",
|
|
273
|
+
"available": true,
|
|
274
|
+
"quoteable": true,
|
|
275
|
+
"purchasable": true,
|
|
276
|
+
"live_money": true,
|
|
277
|
+
"buyer_modes": ["agent_only", "hybrid"],
|
|
278
|
+
"requires_browser": false,
|
|
279
|
+
"default_pack_id": "starter-500",
|
|
280
|
+
"purchase_endpoint": "/v1/credit-purchases/stripe-x402-deposits"
|
|
260
281
|
}
|
|
261
282
|
]
|
|
262
283
|
}
|
|
263
284
|
```
|
|
264
285
|
|
|
265
|
-
Public payment discovery is intentionally action-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
`
|
|
286
|
+
Public payment discovery is intentionally action-first. Limited-rollout rails
|
|
287
|
+
may be returned with `available:false`, `quoteable:false`, `purchasable:false`,
|
|
288
|
+
and a non-null `unavailable_reason` so headless agents can understand the path
|
|
289
|
+
without trying it. Use a method only when it is returned with `available:true`,
|
|
290
|
+
`quoteable:true`, and `purchasable:true`.
|
|
269
291
|
|
|
270
292
|
Hosted API equivalent:
|
|
271
293
|
|
|
@@ -275,10 +297,13 @@ curl -sS https://api.image-skill.com/v1/payment-methods
|
|
|
275
297
|
|
|
276
298
|
### `image-skill credits packs list`
|
|
277
299
|
|
|
278
|
-
Lists the recommended Image Skill credit packs
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
300
|
+
Lists the recommended Image Skill credit packs. Packs are the default
|
|
301
|
+
live-money buying UX because agents get obvious starter choices and avoid tiny
|
|
302
|
+
fee traps. Use the payment method catalog to choose the rail: browserless
|
|
303
|
+
`stripe_x402.exact.usdc` when it is available for agent self-funding, or
|
|
304
|
+
`stripe_checkout` when a human sponsor needs a Checkout handoff. Exact custom
|
|
305
|
+
quotes are still supported when an agent already knows the required credit
|
|
306
|
+
budget.
|
|
282
307
|
|
|
283
308
|
```bash
|
|
284
309
|
image-skill credits packs list --json
|
|
@@ -317,8 +342,10 @@ curl -sS https://api.image-skill.com/v1/credit-packs
|
|
|
317
342
|
|
|
318
343
|
### `image-skill credits quote`
|
|
319
344
|
|
|
320
|
-
Requests a bounded credit quote from the hosted service. Public top-ups use
|
|
321
|
-
|
|
345
|
+
Requests a bounded credit quote from the hosted service. Public top-ups use the
|
|
346
|
+
payment method returned by `credits methods --json`: `stripe_x402.exact.usdc`
|
|
347
|
+
for browserless agent self-funding when it is available, or
|
|
348
|
+
`stripe_checkout` for the human Checkout fallback. A quote never grants
|
|
322
349
|
credits.
|
|
323
350
|
One Image Skill credit is a stable user-facing value unit worth `$0.01`.
|
|
324
351
|
Creative operations can consume more than one credit based on the selected
|
|
@@ -354,6 +381,17 @@ image-skill credits quote \
|
|
|
354
381
|
--json
|
|
355
382
|
```
|
|
356
383
|
|
|
384
|
+
For the browserless agent x402 rail, quote the exact method id returned by
|
|
385
|
+
`credits methods --json`:
|
|
386
|
+
|
|
387
|
+
```bash
|
|
388
|
+
image-skill credits quote \
|
|
389
|
+
--pack starter-500 \
|
|
390
|
+
--payment-method stripe_x402.exact.usdc \
|
|
391
|
+
--idempotency-key agent-x402-quote-run-001 \
|
|
392
|
+
--json
|
|
393
|
+
```
|
|
394
|
+
|
|
357
395
|
For exact custom Stripe Checkout terms, request the provider and bounded credit
|
|
358
396
|
amount explicitly:
|
|
359
397
|
|
|
@@ -383,22 +421,77 @@ Minimum success data:
|
|
|
383
421
|
}
|
|
384
422
|
```
|
|
385
423
|
|
|
424
|
+
For x402 quotes, `accepted_payment_method` is
|
|
425
|
+
`"stripe_x402.exact.usdc"` and the response includes redacted
|
|
426
|
+
`quote.x402` metadata for the agent-payable deposit flow.
|
|
427
|
+
|
|
386
428
|
Hosted API equivalent:
|
|
387
429
|
|
|
388
430
|
```bash
|
|
389
431
|
curl -sS https://api.image-skill.com/v1/credit-quotes \
|
|
390
432
|
-H "authorization: Bearer $IMAGE_SKILL_TOKEN" \
|
|
391
433
|
-H "content-type: application/json" \
|
|
392
|
-
-d '{"pack_id":"starter-500","payment_method":"
|
|
434
|
+
-d '{"pack_id":"starter-500","payment_method":"stripe_x402.exact.usdc","idempotency_key":"agent-x402-quote-run-001"}'
|
|
393
435
|
```
|
|
394
436
|
|
|
395
437
|
### `image-skill credits buy`
|
|
396
438
|
|
|
397
|
-
Creates a payment action for a previously returned quote.
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
439
|
+
Creates a payment action for a previously returned quote. Choose the provider
|
|
440
|
+
that matches the quote's `accepted_payment_method`.
|
|
441
|
+
|
|
442
|
+
For a `stripe_x402.exact.usdc` quote, `--provider stripe_x402` creates a
|
|
443
|
+
browserless agent-payable USDC deposit challenge. The response is live money
|
|
444
|
+
when `live_money:true`; credits are granted only after verified settlement and
|
|
445
|
+
webhook fulfillment succeeds. Deposit challenge creation itself must not mutate
|
|
446
|
+
credit balances. Stay within the delegated cap and never pass wallet private
|
|
447
|
+
keys, seed phrases, x402 payment headers, deposit client secrets, or provider
|
|
448
|
+
receipts to Image Skill.
|
|
449
|
+
|
|
450
|
+
```bash
|
|
451
|
+
image-skill credits buy \
|
|
452
|
+
--provider stripe_x402 \
|
|
453
|
+
--quote-id quote_... \
|
|
454
|
+
--idempotency-key agent-x402-buy-run-001 \
|
|
455
|
+
--json
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
Minimum x402 action-required data:
|
|
459
|
+
|
|
460
|
+
```json
|
|
461
|
+
{
|
|
462
|
+
"state": "action_required",
|
|
463
|
+
"quote_id": "quote_...",
|
|
464
|
+
"payment_attempt_id": "payatt_...",
|
|
465
|
+
"provider": "stripe",
|
|
466
|
+
"accepted_payment_method": "stripe_x402.exact.usdc",
|
|
467
|
+
"credits": 500,
|
|
468
|
+
"amount_cents": 500,
|
|
469
|
+
"currency": "USD",
|
|
470
|
+
"live_money": true,
|
|
471
|
+
"stripe_x402": {
|
|
472
|
+
"method_id": "stripe_x402.exact.usdc",
|
|
473
|
+
"scheme": "exact",
|
|
474
|
+
"network": "base",
|
|
475
|
+
"token_currency": "usdc",
|
|
476
|
+
"deposit_address_present": true,
|
|
477
|
+
"redacted": {
|
|
478
|
+
"payment_intent_id": "[redacted-stripe-payment-intent]",
|
|
479
|
+
"deposit_address": "[redacted-stripe-crypto-deposit-address]",
|
|
480
|
+
"client_secret": "[redacted-stripe-client-secret]"
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
"next": {
|
|
484
|
+
"agent_action": "pay_stripe_crypto_deposit",
|
|
485
|
+
"suggested_commands": [
|
|
486
|
+
"image-skill credits status --payment-attempt-id payatt_... --json"
|
|
487
|
+
]
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
For a `stripe_checkout` quote, `--provider stripe` creates a hosted Stripe
|
|
493
|
+
Checkout Session and returns an `action_required` response with
|
|
494
|
+
`checkout_handoff_url`.
|
|
402
495
|
|
|
403
496
|
Agents should present or open `checkout_handoff_url` for humans. It is a short
|
|
404
497
|
Image Skill URL that redirects to Stripe Checkout and is safe to copy from
|
|
@@ -408,8 +501,7 @@ provide one. `checkout_url` is the raw Stripe compatibility fallback only; do
|
|
|
408
501
|
not present it unless no handoff URL is available. Do not trim Stripe Checkout
|
|
409
502
|
URLs: the long `#...` fragment is required by Stripe Checkout in the browser.
|
|
410
503
|
Present any fallback Stripe URL in a fenced code block so terminal wrapping does
|
|
411
|
-
not corrupt it.
|
|
412
|
-
Stripe-hosted Checkout may also show a promotion-code field for
|
|
504
|
+
not corrupt it. Stripe-hosted Checkout may also show a promotion-code field for
|
|
413
505
|
operator-provided codes; agents should let the human enter those codes on
|
|
414
506
|
Stripe, never collect promo codes, card details, or wallet credentials in the
|
|
415
507
|
Image Skill CLI.
|
|
@@ -458,11 +550,20 @@ curl -sS https://api.image-skill.com/v1/credit-purchases/stripe-checkout-session
|
|
|
458
550
|
-d '{"quote_id":"quote_...","idempotency_key":"stripe-buy-run-001"}'
|
|
459
551
|
```
|
|
460
552
|
|
|
553
|
+
x402 hosted API equivalent:
|
|
554
|
+
|
|
555
|
+
```bash
|
|
556
|
+
curl -sS https://api.image-skill.com/v1/credit-purchases/stripe-x402-deposits \
|
|
557
|
+
-H "authorization: Bearer $IMAGE_SKILL_TOKEN" \
|
|
558
|
+
-H "content-type: application/json" \
|
|
559
|
+
-d '{"quote_id":"quote_...","idempotency_key":"agent-x402-buy-run-001"}'
|
|
560
|
+
```
|
|
561
|
+
|
|
461
562
|
### `image-skill credits status`
|
|
462
563
|
|
|
463
|
-
Shows the durable state of a quote,
|
|
464
|
-
or receipt. Use this after `credits buy` so agents
|
|
465
|
-
state from quota deltas or activity text.
|
|
564
|
+
Shows the durable state of a quote, x402 deposit attempt, Stripe Checkout
|
|
565
|
+
attempt, Checkout Session, or receipt. Use this after `credits buy` so agents
|
|
566
|
+
do not have to infer payment state from quota deltas or activity text.
|
|
466
567
|
|
|
467
568
|
```bash
|
|
468
569
|
image-skill credits status \
|
|
@@ -516,10 +617,13 @@ curl -sS "https://api.image-skill.com/v1/credit-purchases/status?payment_attempt
|
|
|
516
617
|
```
|
|
517
618
|
|
|
518
619
|
Do not pass card data, wallet secrets, provider receipts, Stripe secrets, MPP
|
|
519
|
-
tokens, SPTs, live x402 payment headers,
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
620
|
+
tokens, SPTs, live x402 payment headers, deposit client secrets, wallet
|
|
621
|
+
private keys, seed phrases, or any payment credential to credits commands.
|
|
622
|
+
Stripe Checkout collects payment details only on Stripe-hosted pages; x402
|
|
623
|
+
settlement is handled by the agent/wallet against the returned redacted deposit
|
|
624
|
+
challenge, not by pasting credentials into Image Skill. The public request
|
|
625
|
+
fields are `credits`, `pack_id`, `payment_method`, `quote_id`, status reference
|
|
626
|
+
IDs, and `idempotency_key`.
|
|
523
627
|
|
|
524
628
|
### `image-skill models`
|
|
525
629
|
|
|
@@ -651,6 +755,12 @@ image-skill create --guide --prompt "A compact field camera on a stainless workb
|
|
|
651
755
|
auth/quota/payment blockers, and mutation flags. All mutation flags must be
|
|
652
756
|
false in guide mode: no provider call, hosted create, signup, payment object,
|
|
653
757
|
credit debit, or media write.
|
|
758
|
+
In guide cost output, `cost.estimated_usd_per_image` is the estimated Image
|
|
759
|
+
Skill debit in dollars for one output, matching
|
|
760
|
+
`cost.estimated_debit_usd_per_image` and
|
|
761
|
+
`cost.estimated_credits * cost.credit_unit_usd` when credit pricing is known.
|
|
762
|
+
`cost.estimated_provider_usd_per_image` is the upstream provider estimate for
|
|
763
|
+
transparency; do not use it as the amount the agent needs to fund.
|
|
654
764
|
|
|
655
765
|
```bash
|
|
656
766
|
image-skill create \
|
|
@@ -670,10 +780,9 @@ intents, Image Skill may default an eligible quality-capability request to a
|
|
|
670
780
|
higher output tier only when `--max-estimated-usd-per-image` is high enough for
|
|
671
781
|
that tier; otherwise it stays on a lower-cost quality tier or chooses a cheaper
|
|
672
782
|
capability within the budget and tells agents what happened in the selection
|
|
673
|
-
receipt.
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
permit the 2k plan.
|
|
783
|
+
receipt. Use the `--max-estimated-usd-per-image` value returned by
|
|
784
|
+
`create --guide`; it is sized to the Image Skill credit debit, not only the
|
|
785
|
+
upstream provider estimate.
|
|
677
786
|
|
|
678
787
|
Preview-compatible richer shape:
|
|
679
788
|
|
|
@@ -695,7 +804,8 @@ top-level Image Skill create control; do not pass provider-native `n` through
|
|
|
695
804
|
`model_parameters` unless the selected model schema explicitly advertises that
|
|
696
805
|
field. Credit pricing and `cost.credit_pricing.credits_required` are total
|
|
697
806
|
operation debits across all requested outputs. `--max-estimated-usd-per-image`
|
|
698
|
-
and raw API `max_estimated_usd_per_image`
|
|
807
|
+
and raw API `max_estimated_usd_per_image` are per-image Image Skill debit
|
|
808
|
+
budget guards.
|
|
699
809
|
|
|
700
810
|
Generate video through the same `create` command and durable-media loop. Because
|
|
701
811
|
the no-model default selects an image model, request a video model by id; the
|