Skip to content

v2: expose price response from inference API#26

Draft
montyanderson wants to merge 1 commit into
masterfrom
feat/price-response
Draft

v2: expose price response from inference API#26
montyanderson wants to merge 1 commit into
masterfrom
feat/price-response

Conversation

@montyanderson

Copy link
Copy Markdown
Member

Summary

  • Adds opt-in price: true option to ProdiaJobOptions that passes ?price=true query parameter to the inference API
  • Adds ProdiaJobPrice type ({ product: string; dollars: number }) and optional price field on ProdiaJobResult
  • No behavioral change unless price: true is explicitly passed

Usage

const result = await prodia.job(
  { type: "inference.flux.dev.txt2img.v1", config: { prompt: "a cat" } },
  { price: true },
);

console.log(result.job.price?.product); // "inference-flux-dev-txt2img-v1"
console.log(result.job.price?.dollars); // 0.05

Test plan

  • Verify ?price=true query param is sent when option is set
  • Verify price field is correctly parsed from job response
  • Verify no query param is sent when option is omitted

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Feb 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/price-response

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@montyanderson montyanderson changed the base branch from master to fix/uint8array-type-error February 26, 2026 11:34
@montyanderson montyanderson force-pushed the fix/uint8array-type-error branch from daee559 to 344c677 Compare February 26, 2026 11:38
Add opt-in `price` option to job requests that passes `?price=true`
query parameter to the inference API. When enabled, the job result
includes a `price` field with `product` and `dollars`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@montyanderson montyanderson changed the base branch from fix/uint8array-type-error to master February 26, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant