LogoLogo
Python SDKSlack
  • Documentation
  • Cookbooks
  • Self-Hosting
  • Release Notes
  • Reference
  • Arize AI
  • Quickstarts
  • โœจArize Copilot
  • Concepts
    • Agent Evaluation
    • Tracing
      • What is OpenTelemetry?
      • What is OpenInference?
      • Openinference Semantic Conventions
    • Evaluation
  • ๐ŸงชDevelop
    • Quickstart: Experiments
    • Datasets
      • Create a dataset
      • Update a dataset
      • Export a dataset
    • Experiments
      • Run experiment
        • Run experiment in code
        • Log experiment results via SDK
        • Experiments SDK differences in AX vs Phoenix
      • Evaluate experiment
        • Evaluate experiment in code
      • CI/CD with experiments
        • Github Action Basics
        • Gitlab CI/CD Basics
      • Download experiment
    • Prompt Playground
      • Span Replay
      • Compare Prompts Side-by-Side
      • Load a Dataset into Playground
      • Save Playground Outputs as an Experiment
      • Using Tools in Playground
      • Image Inputs in Playground
      • โœจCopilot: Prompt Builder
    • Playground Integrations
      • OpenAI
      • Azure OpenAI
      • AWS Bedrock
      • VertexAI
      • Custom LLM Models
    • Prompt Hub
  • ๐Ÿง Evaluate
    • Online Evals
      • Run evaluations in the UI
      • Run evaluations with code
      • Test LLM evaluator in playground
      • View task details & logs
      • โœจCopilot: Eval Builder
      • โœจCopilot: Eval Analysis
      • โœจCopilot: RAG Analysis
    • Experiment Evals
    • LLM as a Judge
      • Custom Eval Templates
      • Arize Templates
        • Agent Tool Calling
        • Agent Tool Selection
        • Agent Parameter Extraction
        • Agent Path Convergence
        • Agent Planning
        • Agent Reflection
        • Hallucinations
        • Q&A on Retrieved Data
        • Summarization
        • Code Generation
        • Toxicity
        • AI vs Human (Groundtruth)
        • Citation
        • User Frustration
        • SQL Generation
    • Code Evaluations
    • Human Annotations
      • Annotate spans
      • Setup labeling queues
  • ๐Ÿ”ญObserve
    • Quickstart: Tracing
    • Tracing
      • Setup Tracing
      • How to: Trace Manually
        • Trace Function Calls
        • Instrument with OpenInference Helpers
        • How to Send to a Specific Project and Space ID
        • Get the Current Span/Context and Tracer
        • Log Prompt Templates & Variables
        • Add Attributes, Metadata and Tags to Span
        • Add Events, Exceptions and Status to Spans
        • Configure OTEL Tracer
        • Create LLM, Retriever and Tool Spans
        • Create Tool Spans
        • Log Input
        • Log Outputs
        • Mask Span Attributes
        • Redact Sensitive Data from Traces
        • Send Traces from Phoenix -> Arize
        • Log as Inferences
        • Advanced Tracing (OTEL) Examples
      • How to: Query Traces
        • Filter Traces
          • Time Filtering
        • Export Traces
        • โœจAI Powered Search & Filter
        • โœจAI Powered Trace Analysis
        • โœจAI Span Analysis & Evaluation
    • Tracing Integrations
      • OpenAI
      • OpenAI Agents SDK
      • LlamaIndex
      • LlamaIndex Workflows
      • LangChain
      • LangGraph
      • Hugging Face smolagents
      • Autogen
      • Google GenAI (Gemini)
      • Vertex AI
      • Amazon Bedrock
      • Amazon Bedrock Agents
      • MistralAI
      • Anthropic
      • LangFlow
      • Haystack
      • LiteLLM
      • CrewAI
      • Groq
      • DSPy
      • Guardrails AI
      • Prompt flow
      • Vercel AI SDK
      • Llama
      • Together AI
      • OpenTelemetry (arize-otel)
      • BeeAI
    • Evals on Traces
    • Guardrails
    • Sessions
    • Dashboards
      • Dashboard Widgets
      • Tracking Token Usage
      • โœจCopilot: Dashboard Widget Creation
    • Monitors
      • Integrations: Monitors
        • Slack
          • Manual Setup
        • OpsGenie
        • PagerDuty
      • LLM Red Teaming
    • Custom Metrics & Analytics
      • Arize Query Language Syntax
        • Conditionals and Filters
        • All Operators
        • All Functions
      • Custom Metric Examples
      • โœจCopilot: ArizeQL Generator
  • ๐Ÿ“ˆMachine Learning
    • Machine Learning
      • User Guide: ML
      • Quickstart: ML
      • Concepts: ML
        • What Is A Model Schema
        • Delayed Actuals and Tags
        • ML Glossary
      • How To: ML
        • Upload Data to Arize
          • Pandas SDK Example
          • Local File Upload
            • File Upload FAQ
          • Table Ingestion Tuning
          • Wildcard Paths for Cloud Storage
          • Troubleshoot Data Upload
          • Sending Data FAQ
        • Monitors
          • ML Monitor Types
          • Configure Monitors
            • Notifications Providers
          • Programmatically Create Monitors
          • Best Practices for Monitors
        • Dashboards
          • Dashboard Widgets
          • Dashboard Templates
            • Model Performance
            • Pre-Production Performance
            • Feature Analysis
            • Drift
          • Programmatically Create Dashboards
        • Performance Tracing
          • Time Filtering
          • โœจCopilot: Performance Insights
        • Drift Tracing
          • โœจCopilot: Drift Insights
          • Data Distribution Visualization
          • Embeddings for Tabular Data (Multivariate Drift)
        • Custom Metrics
          • Arize Query Language Syntax
            • Conditionals and Filters
            • All Operators
            • All Functions
          • Custom Metric Examples
          • Custom Metrics Query Language
          • โœจCopilot: ArizeQL Generator
        • Troubleshoot Data Quality
          • โœจCopilot: Data Quality Insights
        • Explainability
          • Interpreting & Analyzing Feature Importance Values
          • SHAP
          • Surrogate Model
          • Explainability FAQ
          • Model Explainability
        • Bias Tracing (Fairness)
        • Export Data to Notebook
        • Automate Model Retraining
        • ML FAQ
      • Use Cases: ML
        • Binary Classification
          • Fraud
          • Insurance
        • Multi-Class Classification
        • Regression
          • Lending
          • Customer Lifetime Value
          • Click-Through Rate
        • Timeseries Forecasting
          • Demand Forecasting
          • Churn Forecasting
        • Ranking
          • Collaborative Filtering
          • Search Ranking
        • Natural Language Processing (NLP)
        • Common Industry Use Cases
      • Integrations: ML
        • Google BigQuery
          • GBQ Views
          • Google BigQuery FAQ
        • Snowflake
          • Snowflake Permissions Configuration
        • Databricks
        • Google Cloud Storage (GCS)
        • Azure Blob Storage
        • AWS S3
          • Private Image Link Access Via AWS S3
        • Kafka
        • Airflow Retrain
        • Amazon EventBridge Retrain
        • MLOps Partners
          • Algorithmia
          • Anyscale
          • Azure & Databricks
          • BentoML
          • CML (DVC)
          • Deepnote
          • Feast
          • Google Cloud ML
          • Hugging Face
          • LangChain ๐Ÿฆœ๐Ÿ”—
          • MLflow
          • Neptune
          • Paperspace
          • PySpark
          • Ray Serve (Anyscale)
          • SageMaker
            • Batch
            • RealTime
            • Notebook Instance with Greater than 20GB of Data
          • Spell
          • UbiOps
          • Weights & Biases
      • API Reference: ML
        • Python SDK
          • Pandas Batch Logging
            • Client
            • log
            • Schema
            • TypedColumns
            • EmbeddingColumnNames
            • ObjectDetectionColumnNames
            • PromptTemplateColumnNames
            • LLMConfigColumnNames
            • LLMRunMetadataColumnNames
            • NLP_Metrics
            • AutoEmbeddings
            • utils.types.ModelTypes
            • utils.types.Metrics
            • utils.types.Environments
          • Single Record Logging
            • Client
            • log
            • TypedValue
            • Ranking
            • Multi-Class
            • Object Detection
            • Embedding
            • LLMRunMetadata
            • utils.types.ModelTypes
            • utils.types.Metrics
            • utils.types.Environments
        • Java SDK
          • Constructor
          • log
          • bulkLog
          • logValidationRecords
          • logTrainingRecords
        • R SDK
          • Client$new()
          • Client$log()
        • Rest API
    • Computer Vision
      • How to: CV
        • Generate Embeddings
          • How to Generate Your Own Embedding
          • Let Arize Generate Your Embeddings
        • Embedding & Cluster Analyzer
        • โœจCopilot: Embedding Summarization
        • Similarity Search
        • Embedding Drift
        • Embeddings FAQ
      • Integrations: CV
      • Use Cases: CV
        • Image Classification
        • Image Segmentation
        • Object Detection
      • API Reference: CV
Powered by GitBook

Support

  • Chat Us On Slack
  • support@arize.com

Get Started

  • Signup For Free
  • Book A Demo

Copyright ยฉ 2025 Arize AI, Inc

On this page
  • Querying for Models
  • Model Versions
  • Model Schema
  • Tracing Schema
  • Dimension Configuration
  • Dimension Details
  • Dimension Values
  • Set Model Baseline
  • Deleting Data

Was this helpful?

  1. Resources
  2. GraphQL API

Models API

Learn how to query models and delete data using our programmatic API

Last updated 3 months ago

Was this helpful?

For a brief overview of GraphQL itself, please consult our .

Querying for Models

Models belong to a Space. Because of this, you can either query for models off of a Space node or a Model node directly.

The model or space id is in the url when you visit the corresponding page. The format looks like this: spaces/:space_id/models/:model_id.

You can also query for a list of models given the space id. More details .

query {
  node(id: "model_id") {
    ... on Model {
      name
      modelType
      uri
    }
  }
}
query {
  node(id: "space_id") {
    ... on Space {
      models(first: 50) {
        edges {
          node {
            id
            name
          }
        }
      }
    }
  }
}

The ModelsConnection off of Space provides a convenient way for you to pull models that match the given criteria. If you have a large number of models, you will have to use pagination to pull the complete list. This data can then be structured to your liking and be exported to the platform of your choosing.

Model Versions

You can query for modelVersions using the model node. If you have a large number of versions, you will have to use pagination to pull the complete list.

query getModelVersion($modelID: ID!) {
        model: node(id: $modelID) {
            ... on Model {
                id
                name
                modelType
                modelVersions(first:1) {
                    edges {
                        node {
                          modelVersionBatches{
                            edges{
                              node{
                                id
                              }
                            }
                          }
                        }
                    }
                }
            }
        }
    }

Variables

{"modelID": "model_id"}

Model Schema

query {
  node(id: "model_id") {
    ... on Model {
      name
      modelSchema {
        features(first: 10) {
          edges {
            node {
              dimension {
                name
              }
            }
          }
        }
      }
    }
  }
}

Tracing Schema

query TraciningSchemaQuery(
  $id: ID!, 
  $startTime: DateTime!, 
  $endTime: DateTime!) {
  model: node(id: $id) {
    ... on Model {
      tracingSchema(startTime: $startTime, endTime: $endTime) {
        spanProperties(first: 50) {
          edges {
            node {
              dimension {
                name
                dataType
                category
              }
            }
          }
        }
        llmEvals(first: 50) {
          edges {
            node {
              dimension {
                name
                dataType
                category
              }
            }
          }
        }
        annotations(first: 50) {
          edges {
            node {
              dimension {
                name
                dataType
                category
              }
            }
          }
        }
      }
    }
  }
}

Variables

{
  "id": "MODEL_ID",
  "startTime": "2024-08-14T06:00:00.000Z",
  "endTime": "2024-09-13T17:59:59.999Z"
}

Dimension Configuration

You can query binning information relating to your model's features, actuals, predictions and tags .

query {
  node(id: "model_id") {
    ... on Model {
      name
      modelSchema {
        features(first: 10) {
          edges {
            node {
              dimensionConfig {
                id
                dimensionName
                dimensionCategory
                numBins
                binOption
                bins
              }
            }
          }
        }
      }
    }
  }
}

mutation CreateOrUpdateDimensionConfiguration(
  $input: UpdateDimensionConfigMutationInput!
) {
  updateDimensionConfig(input: $input) {
    dimensionConfig {
      dimensionName
      binOption
      numBins
      bins
      id
    }
  }
}

variables

{
  "input": {
    "modelId": "model_id",
    "dimensionName": "dimension_name",
    "dimensionCategory": "featureLabel",
    "binOption": "equalWidth",
    "numBins": 4
  }

Dimension Details

query getDimensionDetails($modelId: ID!) {
  node(id: $modelId) {
    ... on Model {
      name
      tracingSchema {
        spanProperties(first: 50, searchTerm:$dimensionName) {
          edges {
            node {
              dimension {
                id
                name
                dataType
                category

              }
            }
          }
        }
      }
    }
  }
}

variables

{ "modelId": "MODEL_ID"}
query getDimensionDetails($modelId: ID!, $dimensionName: String!) {
  node(id: $modelId) {
    ... on Model {
      name
      tracingSchema {
        spanProperties(first: 10, searchTerm:$dimensionName) {
          edges {
            node {
              dimension {
                id
                name
                dataType
                category

              }
            }
          }
        }
      }
    }
  }
}

variables

{
"modelId: "MODEL_ID",
"dimensionName": "target_dimension_name"
 }

Dimension Values

query getDimensionValues(
  $modelId: ID!,
  $dimension: DimensionInput
) {
  node(id: $modelId) {
    ... on Model {
      dimensionValues(
        dimension: $dimension
        modelEnvironmentName: tracing
      ) {
        edges {
          node {
            value
            id
          }
        }
      }
    }
  }
}

variables

{
    "modelId": MODEL_ID,
    "dimension": {
        "id": "dimension_id",
        "name": "dimension.name",
        "dataType": "dimension.dataType",
        "category": "dimension.category"
    }
}

Set Model Baseline

To set the model baseline, you can use the following GraphQL mutation:

mutation setModelBasline(
    $modelId: ID!,
  	$filteredMovingWindowSeconds: Float!,
  	$filteredMovingWindowDelaySeconds: Float!
) {
  setModelBaseline(
    input: {
    modelId: $modelId
    referenceType: filtered
    filteredBaseline: {
      modelEnvironmentName: production
      filteredMovingWindowSeconds: $filteredMovingWindowSeconds
      filteredMovingWindowDelaySeconds: $filteredMovingWindowDelaySeconds
    }
  }
  )
  {
    modelBaseline{
      id
    }
  }
}

Variables

{
  "modelId": "model_id",  
  "filteredMovingWindowSeconds": 86400,  // The desired window size in seconds (e.g., 86400 seconds for a 24-hour window)
  "filteredMovingWindowDelaySeconds": 86400  // The desired delay size in seconds (e.g., 86400 seconds for a 24-hour delay)
}

Deleting Data

You can delete data from a specified time period from your model.

mutation deleteData(
  $modelId: ID!
  $startDate: Date!
  $endDate: Date!
  $deleteType: ModelDeleteDataType!
) {
  deleteData(
    input: {
      modelId: $modelId
      startDate: $startDate
      endDate: $endDate
      deleteType: $deleteType
    }
  ) {
    model {
      name
    }
  }
}

variables

{
"modelId": "model_id",
"startDate": "2024-01-01",
"endDate": "2024-01-05",
"deleteType": "PRODUCTION"
}

Arguments

  • startDate: The start date of the period for which data should be deleted. This date is inclusive. Example: "2024-03-01"

  • endDate: The end date of the period for which data should be deleted. This date is exclusive. Example: "2024-03-18"

  • deleteType: The type of data to delete. Possible values:

    • PRODUCTION: Will delete predictions, joined actuals, and shap data.

    • PREPRODUCTION: Will delete training and validation data.

Guidelines

  • For models with delayed actuals created before February 7, 2024, confirm that predictions intended for deletion have their delayed actuals or tags already joined. Unjoined data may resurface after the joiner's next run.

Update functionalities for all models will be available in an upcoming release, resolving the current joining requirement for pre-February 2024 models.

  • Deleting PRODUCTION data removes all associated data within the specified date range; specific versions cannot be targeted.

  • Deleting PREPRODUCTION data removes all data within the date range, with no ability to differentiate between training and validation sets.

  • Deletion is permanent; exercise caution as this action is irreversible.

  • This operation will take ~10 minutes before the deletion is reflected in the UI.

You can query your model's schema through the . The ModelSchema type contains important information about your models such as features , tags, predictions and actuals which is useful when programmatically creating Monitors.

For more examples see the .

Querying a Model's schema can return the equivalent of thousands of REST requests, resulting in a high computation cost on our servers. Be mindful of your complexity score to ensure your call falls within our complexity cost limit. More details .

You can query your project's schema through . The tracingSchema type contains important information about your application such as spanProperties , llmEvals, and annotations.

Note: You can use the above to get the dimension information need to fetch the values.

modelId: The unique identifier for the model whose data is to be deleted. This ID can be grabbed from the URL after /models/ (see for more details).

๐Ÿ“š
Arize GraphQL API
Monitors API documentation
Arize GraphQL API
dimension details query
here
introduction
here
here