Launch Week 02 wrapped — explore all five launches

Create Trace

POSThttps://api.confident-ai.com/v2/traces

Creates a trace in your Confident AI project, with the spans it contains, and returns its uuid. Send metricCollection to evaluate the trace online, threadId to group it into a conversation, userId to attribute it to an end user, or testRunId with metricCollection to record it as a test case of an in-progress test run. Values that are not UUIDs are hashed into one, and the returned uuid is the hashed value.

POST/v2/traces
curl -X POST "https://api.confident-ai.com/v2/traces" \
  -H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "uuid": "<TRACE-UUID>",
  "name": "Geography QA",
  "input": "What is the capital of France?",
  "output": "The capital of France is Paris.",
  "startTime": "2025-01-15T10:30:00Z",
  "endTime": "2025-01-15T10:30:05Z",
  "status": "SUCCESS",
  "environment": "production",
  "metadata": {
    "client": "acme-corp"
  },
  "tags": [
    "geography"
  ],
  "threadId": "thread-42",
  "thread": {
    "id": "thread-42",
    "metadata": {
      "client": "acme-corp",
      "agentId": "geography-agent"
    },
    "tags": [
      "vip"
    ]
  },
  "userId": "end-user-42",
  "metricCollection": "Collection Name",
  "testRunId": "<TEST-RUN-ID>",
  "testCaseId": "<TEST-CASE-ID>",
  "turnId": "<TURN-ID>",
  "retrievalContext": [
    "Paris is the capital and most populous city of France."
  ],
  "context": [
    "Paris is the capital of France."
  ],
  "expectedOutput": "Paris",
  "toolsCalled": [
    {
      "name": "get_landmark_info",
      "type": "FUNCTION",
      "description": "This tool gives information about a mountain.",
      "inputParameters": {
        "mountain": "Everest"
      },
      "output": "8,848 metres",
      "reasoning": "The user asked for the height of a mountain."
    }
  ],
  "expectedTools": [
    {
      "name": "get_landmark_info",
      "type": "FUNCTION",
      "description": "This tool gives information about a mountain.",
      "inputParameters": {
        "mountain": "Everest"
      },
      "output": "8,848 metres",
      "reasoning": "The user asked for the height of a mountain."
    }
  ],
  "spans": [
    {
      "uuid": "<SPAN-UUID>",
      "type": "LLM",
      "name": "OpenAI Call",
      "model": "gpt-4o",
      "provider": "OpenAI",
      "integration": "LangChain",
      "input": "What is the capital of France?",
      "output": "The capital of France is Paris.",
      "startTime": "2025-01-15T10:30:00Z",
      "endTime": "2025-01-15T10:30:02Z"
    }
  ],
  "metricsData": [
    {
      "name": "Answer Relevancy",
      "score": 0.95,
      "success": true,
      "threshold": 0.5,
      "strictMode": false,
      "flaky": false,
      "reason": "The answer directly states the capital of France.",
      "evaluationModel": "gpt-4o",
      "evaluationCost": 0.0004,
      "error": null,
      "errorType": "AI_CONNECTION_ERROR",
      "verboseLogs": null
    }
  ],
  "attachments": {
    "doc-1": {
      "mimeType": "application/pdf",
      "dataBase64": "JVBERi0xLjQK"
    }
  }
}'
200
{
  "success": true,
  "data": {
    "uuid": "<TRACE-UUID>"
  },
  "link": "https://app.confident-ai.com/project/<PROJECT-ID>/observatory/traces/<TRACE-ID>",
  "deprecated": false
}

Headers

  • CONFIDENT_API_KEYstringRequired

    The API key of your Confident AI project.

Request body

  • uuidstringRequired

    The unique identifier of the trace, generated by your application. Values that are not UUIDs are hashed into one, and the hashed uuid is what the response and every later lookup use.

  • namestring

    This is the name of the trace.

  • inputany

    This is the input to the trace, as a string or any JSON value.

  • outputany

    This is the output of the trace, as a string or any JSON value.

  • startTimestringRequired

    This is the time the trace started, as an ISO 8601 datetime.

  • endTimestringRequired

    This is the time the trace ended, as an ISO 8601 datetime.

  • statusenum

    This represents the error status of a trace or span: SUCCESS when it completed, ERRORED when it failed.

    Show 2 enum valuesHide 2 enum values
    • SUCCESS
    • ERRORED
  • environmentenum

    This is the environment where your trace was posted, which helps with separating and debugging traces from different environments on the Confident AI platform.

    Show 4 enum valuesHide 4 enum values
    • production
    • development
    • staging
    • testing
  • metadataobject

    This is any additional metadata associated with the trace.

  • tagslist of strings

    This is any tags associated with the trace, which helps with grouping traces and filtering them on the Confident AI platform.

  • threadIdstring

    This is the unique identifier of the thread associated with the trace, which groups traces in the same thread into a conversation.

  • threadobject

    Thread-level fields applied to the thread record. id is an alternate way to specify the thread and must match top-level threadId if both are provided. metadata and tags only take effect when a thread id is resolvable; successive ingestions merge metadata keys, while tags replace any prior value.

    Show 3 propertiesHide 3 properties
    • idstring

      The thread id. Equivalent to top-level threadId; if both are set they must match.

    • metadataobject | null

      Custom key/value metadata to attach to the thread. Values can be any JSON-serializable type and are stringified server-side. Successive ingestions for the same thread merge metadata keys.

    • tagsarray | null

      Tags to set on the thread. Replaces any previously stored tags.

  • userIdstring

    This is the unique identifier for your end user for the trace.

  • metricCollectionstring

    This is the metric collection you wish to use to evaluate the trace.

  • testRunIdstring

    This is the unique identifier of the test run to associate the trace with. When set, the trace becomes one test case in that test run and metricCollection is required. It cannot be combined with testCaseId.

  • testCaseIdstring

    The id of an existing test case to attach the trace to, when the trace was produced while evaluating that test case.

  • turnIdstring

    The id of the conversational test case turn to attach the trace to, when the trace was produced while evaluating that turn.

  • retrievalContextlist of strings

    This is the retrieval context of your trace, which is to be used for evaluation.

  • contextlist of strings

    This is the ideal retrieval context of your trace, which is to be used for evaluation.

  • expectedOutputstring

    This is the expected output of your trace, which is the ideal actual output and to be used for evaluation.

  • toolsCalledlist of objects

    This is the tools called by your trace, which is to be used for evaluation.

    Show 6 propertiesHide 6 properties
    • namestringRequired

      This is the name of the tool.

    • typeenum

      The type of the tool call, either a function or an MCP tool.

      Show 2 enum valuesHide 2 enum values
      • FUNCTION
      • MCP
    • descriptionstring

      This is the description of the tool.

    • inputParametersobject | null

      This is the input parameters that are passed to the tool.

    • outputany

      This is the output of the tool.

    • reasoningstring

      This is the reasoning your LLM provided for the tool call.

  • expectedToolslist of objects

    This is the expected tools to be called by the trace, which is to be used for evaluation.

    Show 6 propertiesHide 6 properties
    • namestringRequired

      This is the name of the tool.

    • typeenum

      The type of the tool call, either a function or an MCP tool.

      Show 2 enum valuesHide 2 enum values
      • FUNCTION
      • MCP
    • descriptionstring

      This is the description of the tool.

    • inputParametersobject | null

      This is the input parameters that are passed to the tool.

    • outputany

      This is the output of the tool.

    • reasoningstring

      This is the reasoning your LLM provided for the tool call.

  • spanslist of object | object | object | object | object

    This is the list of spans in the trace. Each span's type decides which fields it accepts.

    Show 5 variantsHide 5 variants
    • Base Spanobject

      A plain span with no model, retriever, tool or agent detail.

      Show 19 propertiesHide 19 properties
      • typeenum

        The type of the span. Omit it, or send SPAN, for a plain span.

        Show 1 enum valueHide 1 enum value
        • SPAN
      • uuidstringRequired

        The unique identifier of the span, generated by your application. Values that are not UUIDs are hashed into one.

      • namestringRequired

        This is the name of the span.

      • inputany

        This is the input to the span, as a string or any JSON value.

      • outputany

        This is the output of the span, as a string or any JSON value.

      • errorstring

        This is the error message, if an error occurred inside the span.

      • statusenum

        This represents the error status of a trace or span: SUCCESS when it completed, ERRORED when it failed.

        Show 2 enum valuesHide 2 enum values
        • SUCCESS
        • ERRORED
      • startTimestringRequired

        This is the time the span started, as an ISO 8601 datetime.

      • endTimestringRequired

        This is the time the span ended, as an ISO 8601 datetime.

      • parentUuidstring

        This is the unique identifier of the span's parent span. Omit it for a root span.

      • metadataobject

        This is any additional metadata associated with the span.

      • metricCollectionstring

        This is the metric collection to be used for evaluating the span.

      • retrievalContextlist of strings

        This is the retrieval context of your span, which is to be used for evaluation.

      • contextlist of strings

        This is the ideal retrieval context of your span, which is to be used for evaluation.

      • expectedOutputstring

        This is the expected output of your span, which is the ideal actual output and to be used for evaluation.

      • toolsCalledlist of objects

        This is the tools called by your span, which is to be used for evaluation.

        Show 6 propertiesHide 6 properties
        • namestringRequired

          This is the name of the tool.

        • typeenum

          The type of the tool call, either a function or an MCP tool.

          Show 2 enum valuesHide 2 enum values
          • FUNCTION
          • MCP
        • descriptionstring

          This is the description of the tool.

        • inputParametersobject | null

          This is the input parameters that are passed to the tool.

        • outputany

          This is the output of the tool.

        • reasoningstring

          This is the reasoning your LLM provided for the tool call.

      • expectedToolslist of objects

        This is the expected tools to be called by the span, which is to be used for evaluation.

        Show 6 propertiesHide 6 properties
        • namestringRequired

          This is the name of the tool.

        • typeenum

          The type of the tool call, either a function or an MCP tool.

          Show 2 enum valuesHide 2 enum values
          • FUNCTION
          • MCP
        • descriptionstring

          This is the description of the tool.

        • inputParametersobject | null

          This is the input parameters that are passed to the tool.

        • outputany

          This is the output of the tool.

        • reasoningstring

          This is the reasoning your LLM provided for the tool call.

      • integrationstring

        This is the integration associated with the span.

      • metricsDatalist of objects

        Metric results you already computed for this span, recorded as-is instead of being evaluated by Confident AI.

        Show 12 propertiesHide 12 properties
        • namestringRequired

          The name of the metric.

        • scorenumber | null

          The metric score, typically between 0 and 1.

        • successboolean | null

          Whether the metric passed its threshold.

        • thresholdnumber | null

          The threshold the metric was scored against.

        • strictModeboolean

          Whether the metric ran in strict mode, which outputs a binary score of 0 or 1.

        • flakyboolean

          Whether the metric's verdict was non-deterministic across runs.

        • reasonstring | null

          The reason for the metric score.

        • evaluationModelstring | null

          The model used to evaluate the metric.

        • evaluationCostnumber | null

          The cost of running the evaluation in USD.

        • errorstring | null

          The error message if the evaluation failed.

        • errorTypeenum | null

          Why an evaluation errored: the AI connection or a transformer failed, the evaluation model failed, the test case lacked the parameters the metric needs, or an internal error occurred.

          Show 5 enum valuesHide 5 enum values
          • AI_CONNECTION_ERROR
          • TRANSFORMER_ERROR
          • EVALUATION_MODEL_ERROR
          • INVALID_TEST_CASE_PARAMETERS
          • INTERNAL_ERROR
        • verboseLogsstring | null

          Detailed logs from the evaluation.

    • OR
    • LLM Spanobject

      A span recording a call to a language model, with its model, token counts, costs and the prompt it used.

      Show 30 propertiesHide 30 properties
      • typeenumRequired

        The type of the span, always LLM for an LLM span.

        Show 1 enum valueHide 1 enum value
        • LLM
      • uuidstringRequired

        The unique identifier of the span, generated by your application. Values that are not UUIDs are hashed into one.

      • namestringRequired

        This is the name of the span.

      • inputany

        This is the input to the span, as a string or any JSON value.

      • outputany

        This is the output of the span, as a string or any JSON value.

      • errorstring

        This is the error message, if an error occurred inside the span.

      • statusenum

        This represents the error status of a trace or span: SUCCESS when it completed, ERRORED when it failed.

        Show 2 enum valuesHide 2 enum values
        • SUCCESS
        • ERRORED
      • startTimestringRequired

        This is the time the span started, as an ISO 8601 datetime.

      • endTimestringRequired

        This is the time the span ended, as an ISO 8601 datetime.

      • parentUuidstring

        This is the unique identifier of the span's parent span. Omit it for a root span.

      • metadataobject

        This is any additional metadata associated with the span.

      • metricCollectionstring

        This is the metric collection to be used for evaluating the span.

      • retrievalContextlist of strings

        This is the retrieval context of your span, which is to be used for evaluation.

      • contextlist of strings

        This is the ideal retrieval context of your span, which is to be used for evaluation.

      • expectedOutputstring

        This is the expected output of your span, which is the ideal actual output and to be used for evaluation.

      • toolsCalledlist of objects

        This is the tools called by your span, which is to be used for evaluation.

        Show 6 propertiesHide 6 properties
        • namestringRequired

          This is the name of the tool.

        • typeenum

          The type of the tool call, either a function or an MCP tool.

          Show 2 enum valuesHide 2 enum values
          • FUNCTION
          • MCP
        • descriptionstring

          This is the description of the tool.

        • inputParametersobject | null

          This is the input parameters that are passed to the tool.

        • outputany

          This is the output of the tool.

        • reasoningstring

          This is the reasoning your LLM provided for the tool call.

      • expectedToolslist of objects

        This is the expected tools to be called by the span, which is to be used for evaluation.

        Show 6 propertiesHide 6 properties
        • namestringRequired

          This is the name of the tool.

        • typeenum

          The type of the tool call, either a function or an MCP tool.

          Show 2 enum valuesHide 2 enum values
          • FUNCTION
          • MCP
        • descriptionstring

          This is the description of the tool.

        • inputParametersobject | null

          This is the input parameters that are passed to the tool.

        • outputany

          This is the output of the tool.

        • reasoningstring

          This is the reasoning your LLM provided for the tool call.

      • integrationstring

        This is the integration associated with the span.

      • metricsDatalist of objects

        Metric results you already computed for this span, recorded as-is instead of being evaluated by Confident AI.

        Show 12 propertiesHide 12 properties
        • namestringRequired

          The name of the metric.

        • scorenumber | null

          The metric score, typically between 0 and 1.

        • successboolean | null

          Whether the metric passed its threshold.

        • thresholdnumber | null

          The threshold the metric was scored against.

        • strictModeboolean

          Whether the metric ran in strict mode, which outputs a binary score of 0 or 1.

        • flakyboolean

          Whether the metric's verdict was non-deterministic across runs.

        • reasonstring | null

          The reason for the metric score.

        • evaluationModelstring | null

          The model used to evaluate the metric.

        • evaluationCostnumber | null

          The cost of running the evaluation in USD.

        • errorstring | null

          The error message if the evaluation failed.

        • errorTypeenum | null

          Why an evaluation errored: the AI connection or a transformer failed, the evaluation model failed, the test case lacked the parameters the metric needs, or an internal error occurred.

          Show 5 enum valuesHide 5 enum values
          • AI_CONNECTION_ERROR
          • TRANSFORMER_ERROR
          • EVALUATION_MODEL_ERROR
          • INVALID_TEST_CASE_PARAMETERS
          • INTERNAL_ERROR
        • verboseLogsstring | null

          Detailed logs from the evaluation.

      • modelstring

        This is the LLM model used in the span.

      • providerstring

        This is the provider of the generation model used in the span.

      • endpointstring

        This is the API endpoint the model was called through, for providers that expose more than one.

      • costPerInputTokennumber

        This is the cost per input token of the LLM model.

      • costPerOutputTokennumber

        This is the cost per output token of the LLM model.

      • inputTokenCountinteger

        This is the number of input tokens passed to the LLM model.

      • outputTokenCountinteger

        This is the number of output tokens generated by the LLM model.

      • promptAliasstring

        This is the alias of your prompt which is stored on Confident AI.

      • promptVersionstring

        This is the version assigned to your prompt on Confident AI.

      • promptLabelstring

        This is the label assigned to a specific version of prompt on the Confident AI platform.

      • promptCommitHashstring

        This is the hash of the current prompt being logged in the llm span.

    • OR
    • Retriever Spanobject

      A span recording a knowledge-base lookup, with the embedder and retrieval settings it used.

      Show 22 propertiesHide 22 properties
      • typeenumRequired

        The type of the span, always RETRIEVER for a retriever span.

        Show 1 enum valueHide 1 enum value
        • RETRIEVER
      • uuidstringRequired

        The unique identifier of the span, generated by your application. Values that are not UUIDs are hashed into one.

      • namestringRequired

        This is the name of the span.

      • inputany

        This is the input to the span, as a string or any JSON value.

      • outputany

        This is the output of the span, as a string or any JSON value.

      • errorstring

        This is the error message, if an error occurred inside the span.

      • statusenum

        This represents the error status of a trace or span: SUCCESS when it completed, ERRORED when it failed.

        Show 2 enum valuesHide 2 enum values
        • SUCCESS
        • ERRORED
      • startTimestringRequired

        This is the time the span started, as an ISO 8601 datetime.

      • endTimestringRequired

        This is the time the span ended, as an ISO 8601 datetime.

      • parentUuidstring

        This is the unique identifier of the span's parent span. Omit it for a root span.

      • metadataobject

        This is any additional metadata associated with the span.

      • metricCollectionstring

        This is the metric collection to be used for evaluating the span.

      • retrievalContextlist of strings

        This is the retrieval context of your span, which is to be used for evaluation.

      • contextlist of strings

        This is the ideal retrieval context of your span, which is to be used for evaluation.

      • expectedOutputstring

        This is the expected output of your span, which is the ideal actual output and to be used for evaluation.

      • toolsCalledlist of objects

        This is the tools called by your span, which is to be used for evaluation.

        Show 6 propertiesHide 6 properties
        • namestringRequired

          This is the name of the tool.

        • typeenum

          The type of the tool call, either a function or an MCP tool.

          Show 2 enum valuesHide 2 enum values
          • FUNCTION
          • MCP
        • descriptionstring

          This is the description of the tool.

        • inputParametersobject | null

          This is the input parameters that are passed to the tool.

        • outputany

          This is the output of the tool.

        • reasoningstring

          This is the reasoning your LLM provided for the tool call.

      • expectedToolslist of objects

        This is the expected tools to be called by the span, which is to be used for evaluation.

        Show 6 propertiesHide 6 properties
        • namestringRequired

          This is the name of the tool.

        • typeenum

          The type of the tool call, either a function or an MCP tool.

          Show 2 enum valuesHide 2 enum values
          • FUNCTION
          • MCP
        • descriptionstring

          This is the description of the tool.

        • inputParametersobject | null

          This is the input parameters that are passed to the tool.

        • outputany

          This is the output of the tool.

        • reasoningstring

          This is the reasoning your LLM provided for the tool call.

      • integrationstring

        This is the integration associated with the span.

      • metricsDatalist of objects

        Metric results you already computed for this span, recorded as-is instead of being evaluated by Confident AI.

        Show 12 propertiesHide 12 properties
        • namestringRequired

          The name of the metric.

        • scorenumber | null

          The metric score, typically between 0 and 1.

        • successboolean | null

          Whether the metric passed its threshold.

        • thresholdnumber | null

          The threshold the metric was scored against.

        • strictModeboolean

          Whether the metric ran in strict mode, which outputs a binary score of 0 or 1.

        • flakyboolean

          Whether the metric's verdict was non-deterministic across runs.

        • reasonstring | null

          The reason for the metric score.

        • evaluationModelstring | null

          The model used to evaluate the metric.

        • evaluationCostnumber | null

          The cost of running the evaluation in USD.

        • errorstring | null

          The error message if the evaluation failed.

        • errorTypeenum | null

          Why an evaluation errored: the AI connection or a transformer failed, the evaluation model failed, the test case lacked the parameters the metric needs, or an internal error occurred.

          Show 5 enum valuesHide 5 enum values
          • AI_CONNECTION_ERROR
          • TRANSFORMER_ERROR
          • EVALUATION_MODEL_ERROR
          • INVALID_TEST_CASE_PARAMETERS
          • INTERNAL_ERROR
        • verboseLogsstring | null

          Detailed logs from the evaluation.

      • embedderstringRequired

        This is the embedder model used in the span.

      • topKinteger

        This is the top K chunks retrieved from your knowledge base.

      • chunkSizeinteger

        This is the chunk size of each retrieved context.

    • OR
    • Tool Spanobject

      A span recording a tool call.

      Show 20 propertiesHide 20 properties
      • typeenumRequired

        The type of the span, always TOOL for a tool span.

        Show 1 enum valueHide 1 enum value
        • TOOL
      • uuidstringRequired

        The unique identifier of the span, generated by your application. Values that are not UUIDs are hashed into one.

      • namestringRequired

        This is the name of the span.

      • inputany

        This is the input to the span, as a string or any JSON value.

      • outputany

        This is the output of the span, as a string or any JSON value.

      • errorstring

        This is the error message, if an error occurred inside the span.

      • statusenum

        This represents the error status of a trace or span: SUCCESS when it completed, ERRORED when it failed.

        Show 2 enum valuesHide 2 enum values
        • SUCCESS
        • ERRORED
      • startTimestringRequired

        This is the time the span started, as an ISO 8601 datetime.

      • endTimestringRequired

        This is the time the span ended, as an ISO 8601 datetime.

      • parentUuidstring

        This is the unique identifier of the span's parent span. Omit it for a root span.

      • metadataobject

        This is any additional metadata associated with the span.

      • metricCollectionstring

        This is the metric collection to be used for evaluating the span.

      • retrievalContextlist of strings

        This is the retrieval context of your span, which is to be used for evaluation.

      • contextlist of strings

        This is the ideal retrieval context of your span, which is to be used for evaluation.

      • expectedOutputstring

        This is the expected output of your span, which is the ideal actual output and to be used for evaluation.

      • toolsCalledlist of objects

        This is the tools called by your span, which is to be used for evaluation.

        Show 6 propertiesHide 6 properties
        • namestringRequired

          This is the name of the tool.

        • typeenum

          The type of the tool call, either a function or an MCP tool.

          Show 2 enum valuesHide 2 enum values
          • FUNCTION
          • MCP
        • descriptionstring

          This is the description of the tool.

        • inputParametersobject | null

          This is the input parameters that are passed to the tool.

        • outputany

          This is the output of the tool.

        • reasoningstring

          This is the reasoning your LLM provided for the tool call.

      • expectedToolslist of objects

        This is the expected tools to be called by the span, which is to be used for evaluation.

        Show 6 propertiesHide 6 properties
        • namestringRequired

          This is the name of the tool.

        • typeenum

          The type of the tool call, either a function or an MCP tool.

          Show 2 enum valuesHide 2 enum values
          • FUNCTION
          • MCP
        • descriptionstring

          This is the description of the tool.

        • inputParametersobject | null

          This is the input parameters that are passed to the tool.

        • outputany

          This is the output of the tool.

        • reasoningstring

          This is the reasoning your LLM provided for the tool call.

      • integrationstring

        This is the integration associated with the span.

      • metricsDatalist of objects

        Metric results you already computed for this span, recorded as-is instead of being evaluated by Confident AI.

        Show 12 propertiesHide 12 properties
        • namestringRequired

          The name of the metric.

        • scorenumber | null

          The metric score, typically between 0 and 1.

        • successboolean | null

          Whether the metric passed its threshold.

        • thresholdnumber | null

          The threshold the metric was scored against.

        • strictModeboolean

          Whether the metric ran in strict mode, which outputs a binary score of 0 or 1.

        • flakyboolean

          Whether the metric's verdict was non-deterministic across runs.

        • reasonstring | null

          The reason for the metric score.

        • evaluationModelstring | null

          The model used to evaluate the metric.

        • evaluationCostnumber | null

          The cost of running the evaluation in USD.

        • errorstring | null

          The error message if the evaluation failed.

        • errorTypeenum | null

          Why an evaluation errored: the AI connection or a transformer failed, the evaluation model failed, the test case lacked the parameters the metric needs, or an internal error occurred.

          Show 5 enum valuesHide 5 enum values
          • AI_CONNECTION_ERROR
          • TRANSFORMER_ERROR
          • EVALUATION_MODEL_ERROR
          • INVALID_TEST_CASE_PARAMETERS
          • INTERNAL_ERROR
        • verboseLogsstring | null

          Detailed logs from the evaluation.

      • descriptionstring

        This is the description of the tool used in the span.

    • OR
    • Agent Spanobject

      A span recording an agent step, with the tools and handoffs available to it.

      Show 21 propertiesHide 21 properties
      • typeenumRequired

        The type of the span, always AGENT for an agent span.

        Show 1 enum valueHide 1 enum value
        • AGENT
      • uuidstringRequired

        The unique identifier of the span, generated by your application. Values that are not UUIDs are hashed into one.

      • namestringRequired

        This is the name of the span.

      • inputany

        This is the input to the span, as a string or any JSON value.

      • outputany

        This is the output of the span, as a string or any JSON value.

      • errorstring

        This is the error message, if an error occurred inside the span.

      • statusenum

        This represents the error status of a trace or span: SUCCESS when it completed, ERRORED when it failed.

        Show 2 enum valuesHide 2 enum values
        • SUCCESS
        • ERRORED
      • startTimestringRequired

        This is the time the span started, as an ISO 8601 datetime.

      • endTimestringRequired

        This is the time the span ended, as an ISO 8601 datetime.

      • parentUuidstring

        This is the unique identifier of the span's parent span. Omit it for a root span.

      • metadataobject

        This is any additional metadata associated with the span.

      • metricCollectionstring

        This is the metric collection to be used for evaluating the span.

      • retrievalContextlist of strings

        This is the retrieval context of your span, which is to be used for evaluation.

      • contextlist of strings

        This is the ideal retrieval context of your span, which is to be used for evaluation.

      • expectedOutputstring

        This is the expected output of your span, which is the ideal actual output and to be used for evaluation.

      • toolsCalledlist of objects

        This is the tools called by your span, which is to be used for evaluation.

        Show 6 propertiesHide 6 properties
        • namestringRequired

          This is the name of the tool.

        • typeenum

          The type of the tool call, either a function or an MCP tool.

          Show 2 enum valuesHide 2 enum values
          • FUNCTION
          • MCP
        • descriptionstring

          This is the description of the tool.

        • inputParametersobject | null

          This is the input parameters that are passed to the tool.

        • outputany

          This is the output of the tool.

        • reasoningstring

          This is the reasoning your LLM provided for the tool call.

      • expectedToolslist of objects

        This is the expected tools to be called by the span, which is to be used for evaluation.

        Show 6 propertiesHide 6 properties
        • namestringRequired

          This is the name of the tool.

        • typeenum

          The type of the tool call, either a function or an MCP tool.

          Show 2 enum valuesHide 2 enum values
          • FUNCTION
          • MCP
        • descriptionstring

          This is the description of the tool.

        • inputParametersobject | null

          This is the input parameters that are passed to the tool.

        • outputany

          This is the output of the tool.

        • reasoningstring

          This is the reasoning your LLM provided for the tool call.

      • integrationstring

        This is the integration associated with the span.

      • metricsDatalist of objects

        Metric results you already computed for this span, recorded as-is instead of being evaluated by Confident AI.

        Show 12 propertiesHide 12 properties
        • namestringRequired

          The name of the metric.

        • scorenumber | null

          The metric score, typically between 0 and 1.

        • successboolean | null

          Whether the metric passed its threshold.

        • thresholdnumber | null

          The threshold the metric was scored against.

        • strictModeboolean

          Whether the metric ran in strict mode, which outputs a binary score of 0 or 1.

        • flakyboolean

          Whether the metric's verdict was non-deterministic across runs.

        • reasonstring | null

          The reason for the metric score.

        • evaluationModelstring | null

          The model used to evaluate the metric.

        • evaluationCostnumber | null

          The cost of running the evaluation in USD.

        • errorstring | null

          The error message if the evaluation failed.

        • errorTypeenum | null

          Why an evaluation errored: the AI connection or a transformer failed, the evaluation model failed, the test case lacked the parameters the metric needs, or an internal error occurred.

          Show 5 enum valuesHide 5 enum values
          • AI_CONNECTION_ERROR
          • TRANSFORMER_ERROR
          • EVALUATION_MODEL_ERROR
          • INVALID_TEST_CASE_PARAMETERS
          • INTERNAL_ERROR
        • verboseLogsstring | null

          Detailed logs from the evaluation.

      • availableToolslist of stringsRequired

        This is the list of names of available tools to be used in the span.

      • agentHandoffslist of stringsRequired

        This is the list of potential agent handoffs in the span.

  • metricsDatalist of objects

    Metric results you already computed for this trace, recorded as-is instead of being evaluated by Confident AI.

    Show 12 propertiesHide 12 properties
    • namestringRequired

      The name of the metric.

    • scorenumber | null

      The metric score, typically between 0 and 1.

    • successboolean | null

      Whether the metric passed its threshold.

    • thresholdnumber | null

      The threshold the metric was scored against.

    • strictModeboolean

      Whether the metric ran in strict mode, which outputs a binary score of 0 or 1.

    • flakyboolean

      Whether the metric's verdict was non-deterministic across runs.

    • reasonstring | null

      The reason for the metric score.

    • evaluationModelstring | null

      The model used to evaluate the metric.

    • evaluationCostnumber | null

      The cost of running the evaluation in USD.

    • errorstring | null

      The error message if the evaluation failed.

    • errorTypeenum | null

      Why an evaluation errored: the AI connection or a transformer failed, the evaluation model failed, the test case lacked the parameters the metric needs, or an internal error occurred.

      Show 5 enum valuesHide 5 enum values
      • AI_CONNECTION_ERROR
      • TRANSFORMER_ERROR
      • EVALUATION_MODEL_ERROR
      • INVALID_TEST_CASE_PARAMETERS
      • INTERNAL_ERROR
    • verboseLogsstring | null

      Detailed logs from the evaluation.

  • attachmentsobject

    Map of attachment ids to payloads for all [DEEPEVAL:IMAGE:…] and [DEEPEVAL:PDF:…] markers in this trace. Define attachments at the trace level with the same ids for the same instances.

Response

Create Trace succeeded.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    Show 1 propertyHide 1 property
    • uuidstring

      This is the uuid of the trace. It is the uuid you sent, or its UUID hash when the value you sent was not a UUID.

  • linkstring

    This is the URL of the resource on the Confident AI platform.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI