Skip to content

Accessing API costs #17

Description

@RobertTLange

Is there an easy way to get the API costs similar to the OAI API response.usage.cost_details for a run_result? E.g. for this minimal DeepResearch example:

import os
from parallel import Parallel

client = Parallel(api_key=os.environ["PARALLEL_API_KEY"])

task_run = client.task_run.create(
    input="Create a research report the most recent academic research advancements in web search for LLMs.",
    processor="lite",
)
print(f"Task Created. Run ID: {task_run.run_id}")

run_result = client.task_run.result(task_run.run_id, api_timeout=3600)
print(run_result.output)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions