Parea AI Parea API
The Parea API from Parea AI — 19 operation(s) for parea.
The Parea API from Parea AI — 19 operation(s) for parea.
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:
fu
# --- truncated at 32 KB (92 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/parea/refs/heads/main/openapi/parea-parea-api-openapi.yml