openapi: 3.0.3 info: title: AI REST Parea API version: 1.0.0 description: The Parea AI REST API provides programmatic access to the Parea platform, including trace logging for LLM calls, experiment creation and management, dataset operations, LLM proxy completions, and project management. Authentication is performed via the x-api-key header. contact: url: https://www.parea.ai/ email: support@parea.ai license: name: Proprietary servers: - url: https://parea-ai-backend-us-9ac16cdbc7a7b006.onporter.run description: Parea AI US Production security: - APIKeyHeader: [] tags: - name: Parea paths: /api/parea/v1/: get: summary: Health Check operationId: health_check_api_parea_v1__get responses: '200': description: Successful Response content: application/json: schema: additionalProperties: type: string type: object title: Response Health Check Api Parea V1 Get security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] tags: - Parea /api/parea/v1/completion: post: summary: Completion description: 'Get a completion response using either one of your organization’s deployed prompts, or by providing completion details including prompt and inputs in the request. This endpoint acts as a LLM gateway/proxy endpoint to generate completions from different LLMs.' operationId: completion_api_parea_v1_completion_post requestBody: content: application/json: schema: $ref: '#/components/schemas/CompletionsSchema' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/CompletionsResponseSchema' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] tags: - Parea /api/parea/v1/completion/stream: post: summary: Stream Completion description: 'Get a completion response using either one of your organization’s deployed prompts, or by providing completion details including prompt and inputs in the request. This endpoint acts as a LLM gateway/proxy endpoint to generate completions from different LLMs.' operationId: stream_completion_api_parea_v1_completion_stream_post requestBody: content: application/json: schema: $ref: '#/components/schemas/CompletionsSchema' required: true responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] tags: - Parea /api/parea/v1/deployed-prompt: post: summary: Fetch Deployed Prompt description: Given a deployment_id, fetches the deployed prompt and its details. Can be optionally used to fill-in the templated prompt with provided inputs. operationId: fetch_deployed_prompt_api_parea_v1_deployed_prompt_post requestBody: content: application/json: schema: $ref: '#/components/schemas/DeploymentPromptIdSchema' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/GetDeployedPromptResponseSchema' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] tags: - Parea /api/parea/v1/feedback: post: summary: Record Feedback description: Record any (user) feedback & ground truth/correction of output for a log. operationId: record_feedback_api_parea_v1_feedback_post requestBody: content: application/json: schema: $ref: '#/components/schemas/FeedbackRequestSchema' required: true responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] tags: - Parea /api/parea/v1/trace_log: put: summary: Update Trace Log description: Update fields of a trace log. operationId: update_trace_log_api_parea_v1_trace_log_put requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateLogSchema' required: true responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] tags: - Parea post: summary: Record Trace Log description: Log a (LLM) span to visualize inference results, or chains. operationId: record_trace_log_api_parea_v1_trace_log_post requestBody: content: application/json: schema: $ref: '#/components/schemas/TraceLogSchema' required: true responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] tags: - Parea /api/parea/v1/trace_log/langchain: post: summary: Record Langchain Trace Log operationId: record_langchain_trace_log_api_parea_v1_trace_log_langchain_post requestBody: content: application/json: schema: type: object title: Run required: true responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] tags: - Parea /api/parea/v1/experiment: post: summary: Create Experiment Api description: Create an experiment and get the associated experiment uuid. operationId: create_experiment_api_api_parea_v1_experiment_post requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateExperimentRequestSchema' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExperimentSchema' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] tags: - Parea /api/parea/v1/experiment/{experiment_uuid}/stats: get: summary: Get Experiment Stats Api description: Fetches aggregated stats for every root-level trace log in an experiment. operationId: get_experiment_stats_api_api_parea_v1_experiment__experiment_uuid__stats_get security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] parameters: - name: experiment_uuid in: path required: true schema: type: string title: Experiment Uuid responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExperimentStatsSchema' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' tags: - Parea /api/parea/v1/experiment/{experiment_uuid}/finished: post: summary: Finish Experiment Api description: Finishes an experiment, calculates stats and returns all stats for root trace logs operationId: finish_experiment_api_api_parea_v1_experiment__experiment_uuid__finished_post security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] parameters: - name: experiment_uuid in: path required: true schema: type: string title: Experiment Uuid requestBody: content: application/json: schema: title: Finish Experiment Request $ref: '#/components/schemas/FinishExperimentRequestSchema' nullable: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ExperimentStatsSchema' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' tags: - Parea /api/parea/v1/project: post: summary: Create Or Get Project Api description: Create a project or get the project if it already exists. Is used to find out UUID of project. operationId: create_or_get_project_api_api_parea_v1_project_post requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateGetProjectRequestSchema' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/CreateGetProjectResponseSchema' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] tags: - Parea /api/parea/v1/collection/{test_collection_identifier}: get: summary: Get Test Case Collection By Identifier description: "Fetches dataset/test case collection by its ID or name.\n\nArgs:\n test_collection_identifier (Union[str, int]): ID or name of the test case collection/dataset." operationId: get_test_case_collection_by_identifier_api_parea_v1_collection__test_collection_identifier__get security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] parameters: - name: test_collection_identifier in: path required: true schema: anyOf: - type: string - type: integer title: Test Collection Identifier responses: '200': description: Successful Response content: application/json: schema: title: Response Get Test Case Collection By Identifier Api Parea V1 Collection Test Collection Identifier Get $ref: '#/components/schemas/GetTestCaseCollectionResponseSchema' nullable: true '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' tags: - Parea /api/parea/v1/collection: post: summary: Create Collection description: Creates a dataset operationId: create_collection_api_parea_v1_collection_post requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateTestCaseCollectionRequestSchema' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/CreateTestCaseCollectionResponseSchema' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] tags: - Parea /api/parea/v1/testcases: post: summary: Create Test Cases For Dataset description: "Adds items/test cases to a dataset. If the dataset does not exist, it will be created.\nReturns the IDs of the created items/test cases.\n\nReturns:\n List[int]: List of IDs of the created items/test cases." operationId: create_test_cases_for_dataset_api_parea_v1_testcases_post requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateTestCasesSchema' required: true responses: '200': description: Successful Response content: application/json: schema: items: type: integer type: array title: Response Create Test Cases For Dataset Api Parea V1 Testcases Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] tags: - Parea /api/parea/v1/trace_log/{trace_id}: get: summary: Get Trace Log Api description: Fetches a trace log by its UUID. operationId: get_trace_log_api_api_parea_v1_trace_log__trace_id__get security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] parameters: - name: trace_id in: path required: true schema: type: string title: Trace Id responses: '200': description: Successful Response content: application/json: schema: title: Response Get Trace Log Api Api Parea V1 Trace Log Trace Id Get $ref: '#/components/schemas/TraceLogTreeSchema' nullable: true '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' tags: - Parea /api/parea/v1/experiments: post: summary: List Experiments Api description: Lists experiments given a set of filters incl. their high-level statistics. operationId: list_experiments_api_api_parea_v1_experiments_post requestBody: content: application/json: schema: $ref: '#/components/schemas/ListExperimentsRequestSchema' required: true responses: '200': description: Successful Response content: application/json: schema: items: $ref: '#/components/schemas/ExperimentWithStatsSchema' type: array title: Response List Experiments Api Api Parea V1 Experiments Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] tags: - Parea /api/parea/v1/experiment/{experiment_uuid}/trace_logs: post: summary: Get Experiment Trace Logs Api description: "Fetches all trace logs for an experiment.\n\nArgs:\n experiment_uuid (str): UUID of the experiment.\n\nReturns:\n list[TraceLogTreeSchema]: List of trace logs for the experiment." operationId: get_experiment_trace_logs_api_api_parea_v1_experiment__experiment_uuid__trace_logs_post security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] parameters: - name: experiment_uuid in: path required: true schema: type: string title: Experiment Uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/FilterBaseSchema' responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/TraceLogTreeSchema' title: Response Get Experiment Trace Logs Api Api Parea V1 Experiment Experiment Uuid Trace Logs Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' tags: - Parea /api/parea/v1/get_trace_logs: post: summary: Get Trace Logs Api description: Fetches trace logs and returns them as a paginated response. operationId: get_trace_logs_api_api_parea_v1_get_trace_logs_post requestBody: content: application/json: schema: $ref: '#/components/schemas/QueryParamsPaginationPublic' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PaginatedResponse_TraceLogTreeSchema_' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] tags: - Parea /api/parea/v1/update_test_case/{dataset_id}/{test_case_id}: post: summary: Update Test Case description: "Update the item/test case of the dataset with any given fields.\n\nArgs:\n dataset_id (int): ID of the dataset.\n test_case_id (int): ID of the item/test case.\n update_test_case_request (UpdateTestCasePublicRequestSchema): Request body containing the fields to update." operationId: update_test_case_api_parea_v1_update_test_case__dataset_id___test_case_id__post security: - APIKeyHeader: [] - APIKeyHeader: [] - APIKeyHeader: [] parameters: - name: dataset_id in: path required: true schema: type: integer title: Dataset Id - name: test_case_id in: path required: true schema: type: integer title: Test Case Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateTestCasePublicRequestSchema' responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' tags: - Parea components: schemas: ExperimentStatus: type: string enum: - pending - running - completed - failed title: ExperimentStatus TraceLogAnnotationSchema: properties: trace_id: type: string title: Trace Id description: UUID of associated trace defined_annotation_id: type: integer title: Defined Annotation Id description: Annotation criterion ID score: title: Score description: Annotation score type: number nullable: true value: title: Value description: Annotation value type: string nullable: true id: anyOf: - type: string - type: integer title: Id description: Annotation ID nullable: true created_at: type: string title: Created At description: Annotation creation timestamp user_id: type: string title: User Id description: Parea user ID user_email_address: title: User Email Address description: User email address type: string nullable: true annotation_name: title: Annotation Name description: Annotation name type: string nullable: true type: object required: - trace_id - defined_annotation_id - created_at - user_id title: TraceLogAnnotationSchema ListExperimentsRequestSchema: properties: project_name: title: Project Name description: Name of the project to filter experiments by. type: string nullable: true metadata_filter: title: Metadata Filter description: Filters experiments to contain the given metadata. The metadata_filter is a dictionary where the keys are the metadata keys and the values are the metadata values to filter by. type: object nullable: true experiment_name_filter: title: Experiment Name Filter description: Filters experiments to contain the given string in their name. type: string nullable: true run_name_filter: title: Run Name Filter description: Filters experiments to contain the given string in their run name. type: string nullable: true experiment_uuids: title: Experiment Uuids description: Filters experiments to contain the given UUIDs. items: type: string type: array nullable: true type: object title: ListExperimentsRequestSchema examples: - experiment_name_filter: Hello World metadata_filter: purpose: testing project_name: development run_name_filter: v1 CreateTestCaseCollectionResponseSchema: properties: id: type: integer title: Id description: Unique identifier for the dataset last_updated_at: type: string title: Last Updated At description: Timestamp when the dataset was last updated test_case_ids: items: type: integer type: array title: Test Case Ids description: List of created test case IDs in the dataset type: object required: - id - last_updated_at - test_case_ids title: CreateTestCaseCollectionResponseSchema examples: - id: 5000 last_updated_at: '2021-06-01T00:00:00Z' test_case_ids: - 12345 ExperimentSchema: properties: name: type: string title: Name description: Name of the experiment run_name: title: Run Name description: Name of the run. Must be unique for each experiment and can only contain alphanumeric characters, hyphens, and underscores. type: string nullable: true project_uuid: type: string title: Project Uuid description: UUID of the project associated with this experiment is_public: type: boolean title: Is Public description: If experiment should be public default: false metadata: title: Metadata description: Any additional key-value pairs which provide context or are useful for filtering. additionalProperties: type: string type: object nullable: true uuid: type: string title: Uuid description: UUID of the created experiment created_at: type: string title: Created At description: Timestamp the experiment was created type: object required: - name - project_uuid - uuid - created_at title: ExperimentSchema examples: - created_at: '2024-05-30 13:48:34' metadata: dataset: dev 123 name: Test Experiment project_uuid: '...' run_name: test-experiment uuid: '...' MessageSchema: properties: content: anyOf: - type: string - items: {} type: array title: Content description: Message content default: '' nullable: true role: allOf: - $ref: '#/components/schemas/Role' description: Message role default: user type: object title: MessageSchema CompletionsSchema: properties: llm_inputs: title: Llm Inputs description: Key-value pairs as inputs to prompt template. Only needs to be provided if `deployment_id` is provided or `llm_configuration.messages` are templated. type: object nullable: true llm_configuration: allOf: - $ref: '#/components/schemas/LLMInputsSchema' description: LLM configuration parameters such as messages, functions, etc. default: {} project_name: title: Project Name description: Project name which is used to associate the log with a project. default: default type: string nullable: true project_uuid: title: Project Uuid description: Project UUID which is used to associate the log with a project. Does not need to be provided if the `project_name` is provided. type: string nullable: true experiment_uuid: title: Experiment Uuid description: Experiment UUID which is used to associate the log with an experiment. type: string nullable: true parent_trace_id: title: Parent Trace Id description: UUID of the parent log. If given, will be used to associate the generation in a chain & create hierarchical nested logs. type: string nullable: true root_trace_id: title: Root Trace Id description: UUID of the root log. If given, will be used to associate the generation in a chain & create hierarchical nested logs. type: string nullable: true end_user_identifier: title: End User Identifier description: Special field to track the end user which is interacting with your LLM app. type: string nullable: true deployment_id: title: Deployment Id description: This is the ID for a specific deployed prompt. You can find your deployed prompts on the Deployments tab. If a deployment_id is provided, Parea will fetch all of the associated configuration including model name, model parameters, and any associated functions. Any information provided on the llm_configuration field will be used instead of the associated deployed prompts fields. type: string nullable: true eval_metric_ids: title: Eval Metric Ids description: List of evaluation metric IDs deployed on Parea which should be used to evaluate the completion output. items: type: integer type: array nullable: true metadata: title: Metadata description: Key-value pairs to be associated with the log. type: object nullable: true tags: title: Tags description: List of tags to be associated with the log. items: type: string type: array nullable: true target: title: Target description: Optional ground truth output for the inputs. Will be used for evaluation and can be used when creating a test case from the log. type: string nullable: true trace_id: title: Trace Id description: UUID of the generation log. If not given, will be auto-generated. type: string nullable: true trace_name: title: Trace Name description: Name of the generation log. If not given, will be auto-generated in the format `llm-{provider}`. type: string nullable: true provider_api_key: title: Provider Api Key description: Provider API key to generate response. If not given, API keys saved on the platform will be used type: string nullable: true cache: type: boolean title: Cache description: If true, the completion will be cached to avoid latency & cost for any subsequent completion using the same inputs. default: true log_omit_inputs: type: boolean title: Log Omit Inputs description: If true, the inputs, llm_configuration.messages, llm_configuration.functions, llm_configuration.model_params will not be logged. default: false log_omit_outputs: type: boolean title: Log Omit Outputs description: If true, the generated response will not be logged. default: false log_omit: type: boolean title: Log Omit description: Equivalent to setting both log_omit_inputs and log_omit_outputs to true. default: false log_sample_rate: title: Log Sample Rate description: If specified, this log and its entire associated trace will logged with this probability. Must be between 0 and 1 (incl.). Defaults to 1.0 (i.e., keeping all logs) default: 1.0 type: number maximum: 1.0 minimum: 0.0 nullable: true inference_id: title: Inference Id description: Deprecated field which is the same `trace_id` type: string nullable: true name: title: Name description: Deprecated field type: string nullable: true retry: type: boolean title: Retry description: Deprecated field default: false fallback_strategy: title: Fallback Strategy description: Deprecated field items: type: string type: array nullable: true stream: type: boolean title: Stream description: Deprecated field. Use /completion/stream instead. default: false type: object title: CompletionsSchema examples: - end_user_identifier: 2596@gmail.com inputs: city: New York llm_configuration: function_call: auto functions: - description: Get the current weather in a given location. name: get_current_weather parameters: properties: location: description: The city and state, e.g. San Francisco, CA type: string unit: enum: - celsius - fahrenheit type: string required: - location type: object messages: - content: What is the weather in New York role: user model: gpt-4o-mini model_params: max_length: 500 model: gpt-4o-mini temp: 0.0 provider: openai metadata: purpose: testing user_id: user_2Q9afRAKe6SZrc3U7 tags: - weather - forecast - deployment_id: p-qZrnFesaeCpqcXJ_yL3wi llm_inputs: x: Golang y: Fiber metadata: purpose: testing UpdateLogSchema: properties: trace_id: type: string title: Trace Id description: UUID of the trace log which should be updated field_name_to_value_map: type: object title: Field Name To Value Map description: Key-value pairs how each given field (`key`) of the trace log should be updated with `value`. For field names, see `TraceLogSchema`. root_trace_id: title: Root Trace Id description: UUID of root trace type: string nullable: true type: object required: - trace_id - field_name_to_value_map title: UpdateLogSchema examples: - field_name_to_value_map: error: Some error message status: error trace_id: sasdc-csd-rnFesaeCpqcXJ_yL3wi Role: type: string enum: - user - assistant - system - user - assistant - function - tool title: Role CreateTestCasesSchema: properties: id: title: Id description: ID for the dataset/test case collection. Either ID or name is required to identify the dataset. type: integer nullable: true name: title: Name description: Name for the dataset/test case collection. Either ID or name is required to identify the dataset. type: string nullable: true test_cases: items: $ref: '#/components/schemas/TestCaseSchema' type: array title: Test Cases description: List of items which should be added to dataset. type: object required: - test_cases title: CreateTestCasesSchema examples: - name: Hello World Programs test_cases: - inputs: framework: fastapi language: python tags: - easy target: a good program here - id: 5000 test_cases: - inputs: framework: fastapi language: python tags: - easy target: a good program here PaginatedResponse_TraceLogTreeSchema_: properties: total: type: integer title: Total page: type: integer title: Page total_pages: type: integer title: Total Pages page_size: type: integer title: Page Size results: items: $ref: '#/components/schemas/TraceLogTreeSchema' type: array title: Results type: object required: - total - page - total_pages - page_size - results title: PaginatedResponse[TraceLogTreeSchema] HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError ParamsSchema: properties: model: title: Model description: Model name type: string nullable: true temp: title: Temp description: Temperature type: number nullable: true top_p: title: Top P description: Top p type: number nullable: true frequency_penalty: title: Frequency Penalty description: Frequency penalty type: number nullable: true presence_penalty: title: Presence Penalty description: Presence penalty type: number nullable: true max_length: title: Max Length description: Max. number of completion tokens type: integer nullable: true response_format: title: Response Format description: Response format. See OpenAI docs for definition type: object nullable: true safe_prompt: title: Safe Prompt description: Used for Mistral. type: boolean nullable: true type: object title: ParamsSchema description: 'Additional parameters to run inference of LLMs, such as temperature, top_p, etc. Following the OpenAI API format.' FilterOperator: type: string enum: - equals - not_equals - like - greater_than_or_equal - less_than_or_equal - greater_than - less_than - is_null - exists - in - between title: FilterOperator UpdateTestCasePublicRequestSchema: properties: inputs: title: Inputs description: Key-value pairs for the inputs of that item type: object nullable: true target: title: Target description: Target/ground truth value for the item type: string nullable: true tags: title: Tags description: Tags for the item items: type: string type: array nullable: true type: object title: UpdateTestCasePublicRequestSchema description: Any set field will be used to update the item in the dataset. examples: - inputs: framework: gin language: golang CompletionsResponseSchema: properties: content: type: string title: Content description: Generated completion content. latency: type: number title: Latency description: Latency of the completion in seconds. input_tokens: type: integer title: Input Tokens description: Number of tokens in the input. output_tokens: type: integer title: Output Tokens description: Number of tokens in the output. total_tokens: type: integer title: Total Tokens description: Total number of tokens in the input and output. cost: type: number title: Cost description: Cost of the completion in USD. model: type: string title: Model description: Model name. provider: type: string title: Provider description: Provider name. cache_hit: type: boolean title: Cache Hit description: If true, the completion was fetched from the cache. status: type: string title: Status description: Status of the completion. Either 'success' or 'error'. error: title: Error description: Error message if the completion failed. type: string nullable: true trace_id: title: Trace Id description: UUID of the log of the completion. Will be the same as the `trace_id` in the request if provided. type: string nullable: true start_timestamp: type: string title: Start Timestamp description: Start timestamp of the completion. end_timestamp: type: string title: End Timestamp description: End timestamp of the completion. inference_id: type: string title: Inference Id description: UUID of the log of the completion. The same as the `trace_id` in the request if provided. type: object required: - content - latency - input_tokens - output_tokens - total_tokens - cost - model - provider - cache_hit - status - start_timestamp - end_timestamp - inference_id title: CompletionsResponseSchema example: cache_hit: true content: Sure! Here's a simple Hello World program... cost: 0.0008 end_timestamp: '2024-07-24 18:05:17' input_tokens: 22 latency: 0.0 model: gpt-4o-mini-2024-07-18 output_tokens: 189 start_timestamp: '2024-07-24 18:05:17' status: success total_tokens: 211 trace_id: ush221-d23rfcasc-21cdsc LLMInputsSchema: properties: model: title: Model description: Model name type: string nullable: true provider: description: Provider name $ref: '#/components/schemas/ProviderName' nullable: true model_params: description: Model parameters $ref: '#/components/schemas/ModelParamsSchema' nullable: true messages: title: Messages description: List of messages items: $ref: '#/components/schemas/MessageSchema' type: array nullable: true history: title: History description: List of history messages which are prepended to messages. Useful for chatbot applications which rely on deployed prompts. items: $ref: '#/components/schemas/MessageSchema' type: array nullable: true functions: title: Functions description: List of function schemas, following the OpenAI API format items: {} type: array nullable: true function_call: anyOf: - type: string - additionalProperties: type: string type: object title: Function Call description: Optionally, specify the fnction call, following OpenAI API behavior. nullable: true type: object title: LLMInputsSchema PromptSchema: properties: raw_messages: items: type: object type: array title: Raw Messages description: List of templated messages as they were created in the UI. messages: items: type: object type: array title: Messages description: If `inputs` were given in request, these messages will be the filled-in version of `raw_messages`. Otherwise, they will be the same as `raw_messages`. inputs: title: Inputs description: If you would like to fill in your prompt template with inputs you can provided then as a dictionary. The keys should match the names of the deployed prompt template’s variables. type: object nullable: true type: object required: - raw_messages - messages title: PromptSchema TestCaseSchema: properties: inputs: additionalProperties: type: string type: object title: Inputs description: Dictionary mapping input names to values. Input names correspond to the column names of the test case collection. target: title: Target description: Optional target/ground truth value for the test case/inputs type: string nullable: true tags: items: type: string type: array title: Tags description: List of tags associated with the test case default: [] type: object required: - inputs title: TestCaseSchema examples: - inputs: framework: fastapi language: python tags: - easy target: a good program here ExperimentStatsSchema: properties: parent_trace_stats: items: $ref: '#/components/schemas/TraceStatsSchema' type: array title: Parent Trace Stats description: Stats of root-level trace logs of an experiment type: object required: - parent_trace_stats title: ExperimentStatsSchema description: Contains aggregated stats of all root trace logs of an experiment. examples: - parent_trace_stats: - cost: 0.5 input_tokens: 100 latency: 0.5 output_tokens: 200 scores: - name: accuracy score: 0.5 total_tokens: 300 trace_id: sasdc-csd-rnFesaeCpqcXJ_yL3wi TraceLogSchema: properties: configuration: allOf: - $ref: '#/components/schemas/InputsSchema-Input' description: If this log was a LLM call, this will contain the configuration used for the call. default: {} inputs: title: Inputs description: Key-value pair inputs of this trace. Note, there is a special field to capture messages in LLM calls. You can still use it in the case of LLM calls to track the key-value pairs for prompt templates. type: object nullable: true output: title: Output description: Response of this step/log/function. If response isn’t a string, it needs to be serialized to a string. type: string nullable: true target: title: Target description: "The target or “gold standardâ€\x9D response for the inputs of this log." type: string nullable: true latency: title: Latency description: Latency of this log in seconds. default: 0.0 type: number nullable: true time_to_first_token: title: Time To First Token description: If this was a LLM call, this will contain the time taken to generate the first token. type: number nullable: true input_tokens: title: Input Tokens description: If this was a LLM call, this will contain the number of tokens in the input. default: 0 type: integer nullable: true output_tokens: title: Output Tokens description: If this was a LLM call, this will contain the number of tokens in the output. default: 0 type: integer nullable: true total_tokens: title: Total Tokens description: If this was a LLM call, this will contain the total number of tokens in the input and output. default: 0 type: integer nullable: true cost: title: Cost description: If this was a LLM call, this will contain the cost of the call. default: 0.0 type: number nullable: true trace_id: type: string title: Trace Id description: 'UUID of the trace log. Ex: e3267953-a16f-47f5-b37e-622dbb29d730' start_timestamp: type: string title: Start Timestamp description: Start timestamp parent_trace_id: title: Parent Trace Id description: If given, current trace will be a child of this trace. If current child is not a child, `parent_trace_id` should be equal to `trace_id` type: string nullable: true root_trace_id: title: Root Trace Id description: This is the UUID of the root trace/span of this trace. If current trace is the root trace, `root_trace_id` must be equal to `trace_id` type: string nullable: true project_name: title: Project Name description: Name of the project with which the trace/log should be associated with. Must be provided if `project_uuid` is not provided type: string nullable: true status: title: Status description: If the trace was a `success` or `error` type: string nullable: true error: title: Error description: If `status=error`, this should contain any additional information such as the stacktrace type: string nullable: true output_for_eval_metrics: title: Output For Eval Metrics description: If provided, will be used as output for any specified evaluation metric. type: string nullable: true evaluation_metric_names: title: Evaluation Metric Names description: Names of evaluation metrics deployed on Parea which should be applied to this log. items: type: string type: array nullable: true scores: title: Scores description: Any scores/eval results associated with this log. items: $ref: '#/components/schemas/EvaluationScoreSchema' type: array nullable: true feedback_score: title: Feedback Score description: Any captured (user) feedback on this log type: number nullable: true apply_eval_frac: title: Apply Eval Frac description: If specified, evals given with `evaluation_metric_names` will be applied to this log with this fraction. default: 1.0 type: number nullable: true log_sample_rate: title: Log Sample Rate description: If specified, this log and its entire associated trace will logged with this probability. Must be between 0 and 1 (incl.). Defaults to 1.0 (i.e., keeping all logs) default: 1.0 type: number maximum: 1.0 minimum: 0.0 nullable: true deployment_id: title: Deployment Id description: Optionally, provide the ID of the used deployed prompt in this log. type: string nullable: true cache_hit: type: boolean title: Cache Hit description: If the cache was hit for this log. default: false trace_name: title: Trace Name description: The name of this span. type: string nullable: true children: title: Children description: UUIDs of any children. items: type: string type: array nullable: true children_ids: title: Children Ids description: IDs of any children. Will be automatically populated. items: type: integer type: array nullable: true end_timestamp: title: End Timestamp description: End timestamp of span. type: string nullable: true end_user_identifier: title: End User Identifier description: Unique identifier for a end-user. type: string nullable: true session_id: title: Session Id description: Unique identifier for a session. Can you be used to associated multiple logs in e.g. chat applications. type: string nullable: true metadata: title: Metadata description: Any additional key-value pairs which provide context or are useful for filtering. type: object nullable: true tags: title: Tags description: List of tags which provide additional context or are useful for filtering. items: type: string type: array nullable: true experiment_uuid: title: Experiment Uuid description: If given, will be used to associate this log with an experiment. type: string nullable: true images: title: Images description: Any images associated with trace. items: $ref: '#/components/schemas/TraceLogImage' type: array nullable: true comments: title: Comments description: Any comments on log which were collected on Parea frontend. items: $ref: '#/components/schemas/TraceLogCommentSchema' type: array nullable: true annotations: title: Annotations description: Any annotations on log which were collected on Parea frontend. It maps annoation criterion ID to a dictionary mapping user_id (Parea user ID) to annotation. additionalProperties: additionalProperties: $ref: '#/components/schemas/TraceLogAnnotationSchema' type: object type: object nullable: true depth: type: integer title: Depth description: Depth/level of nestedness of span in overall trace. Root-level trace is 0 and it always increments by 1. default: 0 execution_order: type: integer title: Execution Order description: The execution number of span in trace. It starts with 0 and increments by 1 with every span. default: 0 evaluation_metric_ids: title: Evaluation Metric Ids description: Deprecated items: type: integer type: array nullable: true fill_children: type: boolean title: Fill Children description: Deprecated default: false project_uuid: title: Project Uuid description: UUID of project with which this log is associated. Will be automatically filled-in by SDKs type: string nullable: true organization_id: title: Organization Id description: Organization ID associated with Parea API key. Will be automatically determined from API key type: string nullable: true type: object required: - trace_id - start_timestamp title: TraceLogSchema examples: - depth: 0 end_timestamp: '2024-05-30 13:48:35' execution_order: 0 inputs: x: Golang y: Fiber metadata: purpose: testing output: Some logged output parent_trace_id: <> project_name: default root_trace_id: <> start_timestamp: '2024-05-30 13:48:34' status: success trace_id: <> trace_name: test - configuration: messages: - content: Some prompt role: user model: gpt-4o provider: openai depth: 0 end_timestamp: '2024-05-30 13:48:35' execution_order: 0 inputs: promptTemplateVar1: value promptTemplateVar2: some other value metadata: purpose: testing output: LLM response parent_trace_id: <> project_name: default root_trace_id: <> start_timestamp: '2024-05-30 13:48:34' status: success trace_id: <> trace_name: LLM TraceLogCommentSchema: properties: trace_id: type: string title: Trace Id description: Trace ID comment: type: string title: Comment description: Comment id: anyOf: - type: string - type: integer title: Id description: Comment ID user_id: type: string title: User Id description: User ID user_email_address: title: User Email Address description: User email address type: string nullable: true created_at: type: string title: Created At description: Comment creation timestamp type: object required: - trace_id - comment - id - user_id - created_at title: TraceLogCommentSchema FinishExperimentRequestSchema: properties: status: allOf: - $ref: '#/components/schemas/ExperimentStatus' description: Status of the experiment. Should be completed or failed default: completed dataset_level_stats: title: Dataset Level Stats description: List of dataset level evals/scores which should be added to the experiment. Examples are Pearson correlation between outputs and targets/ground truth values. items: $ref: '#/components/schemas/EvaluationScoreSchema' type: array nullable: true type: object title: FinishExperimentRequestSchema description: Any additional information to be added to the experiment examples: - dataset_level_stats: - name: pearson_correlation score: 0.8 status: completed FeedbackRequestSchema: properties: trace_id: title: Trace Id description: UUID of the trace log type: string nullable: true inference_id: title: Inference Id description: UUID of the trace log type: string nullable: true score: type: number maximum: 1.0 minimum: 0.0 title: Score description: Feedback score comment: title: Comment description: Feedback comment type: string nullable: true target: title: Target description: "Optional target or “gold standardâ€\x9D of log." type: string nullable: true organization_id: title: Organization Id description: Field will be automatically filled-in. type: string nullable: true name: title: Name description: Deprecated field type: string nullable: true type: object required: - score title: FeedbackRequestSchema examples: - name: test score: 0.5 target: perfect answer trace_id: sasdc-csd-rnFesaeCpqcXJ_yL3wi ExperimentPinnedStatistic: properties: var1: type: string title: Var1 description: Name of the first variable var2: title: Var2 description: Name of the second variable type: string nullable: true operation: allOf: - $ref: '#/components/schemas/StatisticOperation' description: What operation was executed on the variables to get value value: type: number title: Value description: Value of the statistic type: object required: - var1 - operation - value title: ExperimentPinnedStatistic examples: - operation: mean value: 0.23 var1: Latency GetTestCaseCollectionResponseSchema: properties: id: type: integer title: Id description: Unique identifier for the test case collection name: type: string title: Name description: Name of the test case collection column_names: items: type: string type: array title: Column Names description: Column names for the test case collection created_at: type: string title: Created At description: Timestamp when the test case collection was created last_updated_at: type: string title: Last Updated At description: Timestamp when the test case collection was last updated test_cases: additionalProperties: $ref: '#/components/schemas/GetTestCaseResponseSchema' type: object title: Test Cases description: Dictionary mapping test case ID to test case type: object required: - id - name - column_names - created_at - last_updated_at - test_cases title: GetTestCaseCollectionResponseSchema examples: - column_names: - language - framework created_at: '2021-06-01T00:00:00Z' id: 5000 last_updated_at: '2021-06-01T00:00:00Z' name: Hello World Programs test_cases: '12345': id: 12345 inputs: framework: fastapi language: python tags: - easy target: a good program here test_case_collection_id: 5000 DeploymentPromptIdSchema: properties: deployment_id: type: string title: Deployment Id description: ID of deployed prompt llm_inputs: title: Llm Inputs description: If provided, these key-value pairs will be used to replace the corresponding keys in the templated prompt type: object nullable: true type: object required: - deployment_id title: DeploymentPromptIdSchema example: deployment_id: p-qZrnFesaeCpqcXJ_yL3wi llm_inputs: x: Python y: Flask GetTestCaseResponseSchema: properties: inputs: additionalProperties: type: string type: object title: Inputs description: Dictionary mapping input names to values. Input names correspond to the column names of the test case collection. target: title: Target description: Optional target/ground truth value for the test case/inputs type: string nullable: true tags: items: type: string type: array title: Tags description: List of tags associated with the test case default: [] id: type: integer title: Id description: Unique identifier for the test case test_case_collection_id: type: integer title: Test Case Collection Id description: Unique identifier for the test case collection of this test case type: object required: - inputs - id - test_case_collection_id title: GetTestCaseResponseSchema examples: - id: 12345 inputs: framework: fastapi language: python tags: - easy target: a good program here test_case_collection_id: 5000 TraceLogImage: properties: url: type: string title: Url description: URL of image caption: title: Caption description: Caption of image type: string nullable: true type: object required: - url title: TraceLogImage StatisticOperation: type: string enum: - mean - median - variance - standard_deviation - min - max - mse - mae - correlation - spearman_correlation - accuracy - custom title: StatisticOperation ModelParamsSchema: properties: model: title: Model description: Model name default: '' type: string nullable: true temp: title: Temp description: Temperature default: 1.0 type: number maximum: 1.0 minimum: 0.0 nullable: true top_p: title: Top P description: Top p default: 1.0 type: number maximum: 1.0 minimum: 0.0 nullable: true frequency_penalty: title: Frequency Penalty description: Frequency penalty default: 0.0 type: number maximum: 2.0 minimum: -2.0 nullable: true presence_penalty: title: Presence Penalty description: Presence penalty default: 0.0 type: number maximum: 2.0 minimum: -2.0 nullable: true max_length: title: Max Length description: Max length of the output type: integer nullable: true response_format: title: Response Format description: Response format type: object nullable: true safe_prompt: title: Safe Prompt description: Safe prompt. Only used for Mistral type: boolean nullable: true type: object title: ModelParamsSchema EvaluationScoreSchema: properties: name: type: string title: Name description: Name of the score / evaluation score: type: number title: Score description: Value of the score evaluation_metric_id: title: Evaluation Metric Id description: Will be automatically populated if this score was from a deployed evaluation metric. type: integer nullable: true reason: title: Reason description: Reason for this score type: string nullable: true type: object required: - name - score title: EvaluationScoreSchema examples: - name: Answer Matches Target reason: The answer is mostly correct but lacks aspect A & B. score: 0.8 CreateExperimentRequestSchema: properties: name: type: string title: Name description: Name of the experiment run_name: title: Run Name description: Name of the run. Must be unique for each experiment and can only contain alphanumeric characters, hyphens, and underscores. type: string nullable: true project_uuid: type: string title: Project Uuid description: UUID of the project associated with this experiment is_public: type: boolean title: Is Public description: If experiment should be public default: false metadata: title: Metadata description: Any additional key-value pairs which provide context or are useful for filtering. additionalProperties: type: string type: object nullable: true type: object required: - name - project_uuid title: CreateExperimentRequestSchema examples: - metadata: dataset: dev 123 name: Test Experiment project_uuid: '...' run_name: test-experiment TraceStatsSchema: properties: trace_id: type: string title: Trace Id description: UUID of top-level trace log latency: title: Latency description: Latency of this log in seconds. default: 0.0 type: number nullable: true input_tokens: title: Input Tokens description: Number of input tokens for all LLM calls in trace (incl. children). default: 0 type: integer nullable: true output_tokens: title: Output Tokens description: Number of output tokens for all LLM calls in trace (incl. children). default: 0 type: integer nullable: true total_tokens: title: Total Tokens description: Total number of tokens for all LLM calls in trace (incl. children). default: 0 type: integer nullable: true cost: title: Cost description: Total cost of all LLM calls in trace (incl. children). type: number nullable: true scores: title: Scores description: Scores of all logs in trace (incl. children). items: $ref: '#/components/schemas/EvaluationScoreSchema' type: array nullable: true type: object required: - trace_id title: TraceStatsSchema description: Aggregates stats for a trace and its children. examples: - cost: 0.5 input_tokens: 100 latency: 0.5 output_tokens: 200 scores: - name: accuracy score: 0.5 total_tokens: 300 trace_id: sasdc-csd-rnFesaeCpqcXJ_yL3wi TimeRange: type: string enum: - na - 1h - 3h - 6h - 24h - 7d - 1m - 3m - 6m - 1y title: TimeRange ProviderName: type: string enum: - openai - azure - anthropic - anyscale - vertexai - aws_bedrock - openrouter - mistral - litellm - groq - fireworks - cohere title: ProviderName CreateGetProjectResponseSchema: properties: name: type: string title: Name description: Name of the project uuid: type: string title: Uuid description: UUID of the project created_at: type: string title: Created At description: Timestamp the project was created was_created: type: boolean title: Was Created description: If the project was created or not. type: object required: - name - uuid - created_at - was_created title: CreateGetProjectResponseSchema examples: - created_at: '2024-05-30 13:48:34' name: development uuid: '...' was_created: false InputsSchema-Output: properties: model: title: Model description: Model name type: string nullable: true provider: title: Provider description: Provider name type: string nullable: true model_params: description: Parameters such as temperature. $ref: '#/components/schemas/ParamsSchema' nullable: true messages: title: Messages description: Messages to LLM items: $ref: '#/components/schemas/MessageSchema' type: array nullable: true functions: title: Functions description: A list of functions the model may generate JSON inputs for. Assumes every item in list has key 'name', 'description' and 'parameters' items: {} type: array nullable: true function_call: anyOf: - type: string - type: object title: Function Call description: "Controls how the model responds to function calls. “autoâ€\x9D means the model can pick between an end-user or calling a function. To specifying a particular function name use a dictionary with key=“nameâ€\x9D and value=“my_functionâ€\x9D. This will force the model to call that function." nullable: true type: object title: InputsSchema description: Inputs for LLM inference such as messages, functions and additional parameters. ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type type: object required: - loc - msg - type title: ValidationError QueryParamsPaginationPublic: properties: page: type: integer title: Page description: Page number starting from 1 default: 1 minimum: 0.0 exclusiveMinimum: true page_size: type: integer maximum: 100000.0 title: Page Size description: Number of items per page default: 20 minimum: 0.0 exclusiveMinimum: true filter_field: title: Filter Field description: 'Field to filter on. If you want to filter by a score, you need to follow this format: ''score:{score_name}''. If you want to filter by annotation, you need to follow this format: ''annotation:{annotation_type}:{annotation_id}''.' type: string nullable: true filter_key: title: Filter Key description: Filter by key when filtering on a map type: string nullable: true filter_operator: description: Filter operator $ref: '#/components/schemas/FilterOperator' nullable: true filter_value: title: Filter Value description: Filter value type: string nullable: true project_name: type: string title: Project Name description: Filter by project name time_range: allOf: - $ref: '#/components/schemas/TimeRange' description: 'Time range for the logs: 1h,3h,6h,24h, 7d, 1m, 3m, 1y or na' default: na status: title: Status description: 'Filter by status: success, error' type: string nullable: true type: object required: - project_name title: QueryParamsPaginationPublic examples: - filter_field: trace_name filter_operator: like filter_value: llm CreateTestCaseCollectionRequestSchema: properties: name: type: string title: Name description: Name of the dataset column_names: items: type: string type: array title: Column Names description: Column names for the dataset test_cases: title: Test Cases description: Name of test cases/samples in the dataset items: $ref: '#/components/schemas/TestCaseSchema' type: array nullable: true type: object required: - name - column_names title: CreateTestCaseCollectionRequestSchema examples: - column_names: - language - framework name: Hello World Programs test_cases: - inputs: framework: fastapi language: python tags: - easy target: a good program here TraceLogTreeSchema: properties: configuration: allOf: - $ref: '#/components/schemas/InputsSchema-Output' description: If this log was a LLM call, this will contain the configuration used for the call. default: {} inputs: title: Inputs description: Key-value pair inputs of this trace. Note, there is a special field to capture messages in LLM calls. You can still use it in the case of LLM calls to track the key-value pairs for prompt templates. type: object nullable: true output: title: Output description: Response of this step/log/function. If response isn’t a string, it needs to be serialized to a string. type: string nullable: true target: title: Target description: "The target or “gold standardâ€\x9D response for the inputs of this log." type: string nullable: true latency: title: Latency description: Latency of this log in seconds. default: 0.0 type: number nullable: true time_to_first_token: title: Time To First Token description: If this was a LLM call, this will contain the time taken to generate the first token. type: number nullable: true input_tokens: title: Input Tokens description: If this was a LLM call, this will contain the number of tokens in the input. default: 0 type: integer nullable: true output_tokens: title: Output Tokens description: If this was a LLM call, this will contain the number of tokens in the output. default: 0 type: integer nullable: true total_tokens: title: Total Tokens description: If this was a LLM call, this will contain the total number of tokens in the input and output. default: 0 type: integer nullable: true cost: title: Cost description: If this was a LLM call, this will contain the cost of the call. default: 0.0 type: number nullable: true trace_id: type: string title: Trace Id description: 'UUID of the trace log. Ex: e3267953-a16f-47f5-b37e-622dbb29d730' start_timestamp: type: string title: Start Timestamp description: Start timestamp parent_trace_id: title: Parent Trace Id description: If given, current trace will be a child of this trace. If current child is not a child, `parent_trace_id` should be equal to `trace_id` type: string nullable: true root_trace_id: title: Root Trace Id description: This is the UUID of the root trace/span of this trace. If current trace is the root trace, `root_trace_id` must be equal to `trace_id` type: string nullable: true project_name: title: Project Name description: Name of the project with which the trace/log should be associated with. Must be provided if `project_uuid` is not provided type: string nullable: true status: title: Status description: If the trace was a `success` or `error` type: string nullable: true error: title: Error description: If `status=error`, this should contain any additional information such as the stacktrace type: string nullable: true output_for_eval_metrics: title: Output For Eval Metrics description: If provided, will be used as output for any specified evaluation metric. type: string nullable: true evaluation_metric_names: title: Evaluation Metric Names description: Names of evaluation metrics deployed on Parea which should be applied to this log. items: type: string type: array nullable: true scores: title: Scores description: Any scores/eval results associated with this log. items: $ref: '#/components/schemas/EvaluationScoreSchema' type: array nullable: true feedback_score: title: Feedback Score description: Any captured (user) feedback on this log type: number nullable: true apply_eval_frac: title: Apply Eval Frac description: If specified, evals given with `evaluation_metric_names` will be applied to this log with this fraction. default: 1.0 type: number nullable: true log_sample_rate: title: Log Sample Rate description: If specified, this log and its entire associated trace will logged with this probability. Must be between 0 and 1 (incl.). Defaults to 1.0 (i.e., keeping all logs) default: 1.0 type: number maximum: 1.0 minimum: 0.0 nullable: true deployment_id: title: Deployment Id description: Optionally, provide the ID of the used deployed prompt in this log. type: string nullable: true cache_hit: type: boolean title: Cache Hit description: If the cache was hit for this log. default: false trace_name: title: Trace Name description: The name of this span. type: string nullable: true children: title: Children description: UUIDs of any children. items: type: string type: array nullable: true children_ids: title: Children Ids description: IDs of any children. Will be automatically populated. items: type: integer type: array nullable: true end_timestamp: title: End Timestamp description: End timestamp of span. type: string nullable: true end_user_identifier: title: End User Identifier description: Unique identifier for a end-user. type: string nullable: true session_id: title: Session Id description: Unique identifier for a session. Can you be used to associated multiple logs in e.g. chat applications. type: string nullable: true metadata: title: Metadata description: Any additional key-value pairs which provide context or are useful for filtering. type: object nullable: true tags: title: Tags description: List of tags which provide additional context or are useful for filtering. items: type: string type: array nullable: true experiment_uuid: title: Experiment Uuid description: If given, will be used to associate this log with an experiment. type: string nullable: true images: title: Images description: Any images associated with trace. items: $ref: '#/components/schemas/TraceLogImage' type: array nullable: true comments: title: Comments description: Any comments on log which were collected on Parea frontend. items: $ref: '#/components/schemas/TraceLogCommentSchema' type: array nullable: true annotations: title: Annotations description: Any annotations on log which were collected on Parea frontend. It maps annoation criterion ID to a dictionary mapping user_id (Parea user ID) to annotation. additionalProperties: additionalProperties: $ref: '#/components/schemas/TraceLogAnnotationSchema' type: object type: object nullable: true depth: type: integer title: Depth description: Depth/level of nestedness of span in overall trace. Root-level trace is 0 and it always increments by 1. default: 0 execution_order: type: integer title: Execution Order description: The execution number of span in trace. It starts with 0 and increments by 1 with every span. default: 0 evaluation_metric_ids: title: Evaluation Metric Ids description: Deprecated items: type: integer type: array nullable: true fill_children: type: boolean title: Fill Children description: Deprecated default: false project_uuid: title: Project Uuid description: UUID of project with which this log is associated. Will be automatically filled-in by SDKs type: string nullable: true organization_id: title: Organization Id description: Organization ID associated with Parea API key. Will be automatically determined from API key type: string nullable: true children_logs: items: $ref: '#/components/schemas/TraceLogTreeSchema' type: array title: Children Logs description: Children logs type: object required: - trace_id - start_timestamp title: TraceLogTreeSchema examples: - depth: 0 end_timestamp: '2024-05-30 13:48:35' execution_order: 0 inputs: x: Golang y: Fiber metadata: purpose: testing output: Some logged output parent_trace_id: <> project_name: default root_trace_id: <> start_timestamp: '2024-05-30 13:48:34' status: success trace_id: <> trace_name: test - configuration: messages: - content: Some prompt role: user model: gpt-4o provider: openai depth: 0 end_timestamp: '2024-05-30 13:48:35' execution_order: 0 inputs: promptTemplateVar1: value promptTemplateVar2: some other value metadata: purpose: testing output: LLM response parent_trace_id: <> project_name: default root_trace_id: <> start_timestamp: '2024-05-30 13:48:34' status: success trace_id: <> trace_name: LLM CreateGetProjectRequestSchema: properties: name: type: string title: Name description: Name of the project type: object required: - name title: CreateGetProjectRequestSchema examples: - name: development GetDeployedPromptResponseSchema: properties: deployment_id: type: string title: Deployment Id description: This is the ID for a deployed prompt. You can find your deployed prompts on the Deployments tab. version_number: type: number title: Version Number description: Version number of the deployed prompt name: title: Name description: Name of the deployed prompt type: string nullable: true functions: title: Functions description: If deployed prompt has function, these will appear as JSON strings. items: type: string type: array nullable: true function_call: title: Function Call description: If deployed prompt has a specified function call, it will appear. type: string nullable: true prompt: description: The messages of the deployed prompt $ref: '#/components/schemas/PromptSchema' nullable: true model: title: Model description: Model name of deployed prompt type: string nullable: true provider: description: Provider name of deployed prompt $ref: '#/components/schemas/ProviderName' nullable: true model_params: title: Model Params description: Model parameters of deployed prompt type: object nullable: true type: object required: - deployment_id - version_number title: GetDeployedPromptResponseSchema examples: - deployment_id: p-qZrnFesaeCpqcXJ_yL3wi functions: [] model: gpt-4o-mini model_params: frequency_penalty: 0.0 presence_penalty: 0.0 temp: 0.5 top_p: 1.0 name: hello world prompt: inputs: x: Python y: Flask messages: - content: I want a Hello World program in Python. Using the Flask framework. role: user raw_messages: - content: I want a Hello World program in {{x}}. Using the {{y}} framework. role: user provider: openai version_number: 1.0 InputsSchema-Input: properties: model: title: Model description: Model name type: string nullable: true provider: title: Provider description: Provider name type: string nullable: true model_params: description: Parameters such as temperature. $ref: '#/components/schemas/ParamsSchema' nullable: true messages: title: Messages description: Messages to LLM items: $ref: '#/components/schemas/MessageSchema' type: array nullable: true functions: title: Functions description: A list of functions the model may generate JSON inputs for. Assumes every item in list has key 'name', 'description' and 'parameters' items: {} type: array nullable: true function_call: anyOf: - type: string - type: object title: Function Call description: "Controls how the model responds to function calls. “autoâ€\x9D means the model can pick between an end-user or calling a function. To specifying a particular function name use a dictionary with key=“nameâ€\x9D and value=“my_functionâ€\x9D. This will force the model to call that function." nullable: true type: object title: InputsSchema description: Inputs for LLM inference such as messages, functions and additional parameters. FilterBaseSchema: properties: filter_field: title: Filter Field description: 'Field to filter on. If you want to filter by a score, you need to follow this format: ''score:{score_name}''. If you want to filter by annotation, you need to follow this format: ''annotation:{annotation_type}:{annotation_id}''.' type: string nullable: true filter_key: title: Filter Key description: Filter by key when filtering on a map type: string nullable: true filter_operator: description: Filter operator $ref: '#/components/schemas/FilterOperator' nullable: true filter_value: title: Filter Value description: Filter value type: string nullable: true type: object title: FilterBaseSchema examples: - filter_field: trace_name filter_operator: like filter_value: llm ExperimentWithStatsSchema: properties: name: type: string title: Name description: Name of the experiment run_name: title: Run Name description: Name of the run. Must be unique for each experiment and can only contain alphanumeric characters, hyphens, and underscores. type: string nullable: true project_uuid: type: string title: Project Uuid description: UUID of the project associated with this experiment is_public: type: boolean title: Is Public description: If experiment should be public default: false metadata: title: Metadata description: Any additional key-value pairs which provide context or are useful for filtering. additionalProperties: type: string type: object nullable: true uuid: type: string title: Uuid description: UUID of the created experiment created_at: type: string title: Created At description: Timestamp the experiment was created status: allOf: - $ref: '#/components/schemas/ExperimentStatus' description: Status of the experiment pinned_stats: items: $ref: '#/components/schemas/ExperimentPinnedStatistic' type: array title: Pinned Stats description: List of population/dataset-level statistics. Typically contains mean of any reported scores, latencies, etc. num_samples: title: Num Samples description: Number of samples in the experiment type: integer nullable: true type: object required: - name - project_uuid - uuid - created_at - status - pinned_stats title: ExperimentWithStatsSchema examples: - created_at: '2024-04-15 22:19:13' is_public: false metadata: dataset: dev 123 name: greeting num_samples: 6 pinned_stats: - operation: mean value: 0.176471 var1: levenshtein - operation: mean value: 2.0e-05 var1: Cost - operation: mean value: 11 var1: Total Tokens - operation: mean value: 9 var1: Output Tokens - operation: mean value: 2 var1: Input Tokens - operation: mean value: 0.65273 var1: Latency project_uuid: '...' run_name: bijou-kail status: completed uuid: '...' securitySchemes: OAuth2PasswordBearer: type: oauth2 flows: password: scopes: {} tokenUrl: token APIKeyHeader: type: apiKey in: header name: x-api-key