Skip to main content
After you’ve built and deployed a model on the Plexe Platform, you can use its API endpoint to make predictions (inferences). This guide explains how to interact with deployed models to get predictions for your data.

Prerequisites

  • A model that has been successfully deployed (status: READY)
  • The deployment ID or endpoint URL
  • A valid API key with appropriate permissions
  • The input schema for your model (what data format it expects)

Getting the Endpoint URL

Before making predictions, you need to know your model’s endpoint URL. You can obtain this in several ways:

From the Console

  1. Log in to Plexe Console
  2. Navigate to ModelsDeployments
  3. Select your deployment
  4. Copy the endpoint URL from the Overview tab

Via the API

When you deploy a model on the Plexe Platform, you’ll be able to get the inference URL from the model status. The URL will be in the format:
Where:
  • {model_name} is the name of your model
  • {model_version} is the version number of your model

Making Single Predictions

For predictions with a single data point, use the simple prediction endpoint.

Using cURL

The response will contain the prediction result:

Using Python

Using JavaScript

Making Batch Predictions

For making predictions with multiple data points at once, use the batch predictions endpoint. This is more efficient than making multiple individual requests.

Using cURL

Using Python

Handling Errors

Common Error Codes

Error Response Format

Python Error Handling Example

Best Practices

  1. Input Validation: Validate inputs before sending to avoid unnecessary API calls
  2. Error Handling: Implement robust error handling with retries for transient errors
  3. Logging: Log request IDs and responses for troubleshooting
  4. Batch Processing: Use the batch predictions endpoint (/predictions) for processing multiple inputs efficiently
  5. Rate Limiting: Manage your request rate to avoid hitting rate limits
  6. Monitoring: Track latency and error rates for your production deployments
  7. Caching: Consider caching prediction results for identical inputs
  8. Timeouts: Set appropriate timeouts for your application’s needs

Performance Optimization

  1. Batch When Possible: Use batch predictions for multiple inputs
  2. Minimize Payload Size: Only include required fields in your requests
  3. Connection Pooling: Reuse HTTP connections for multiple requests
  4. Use CDNs: If serving model in user-facing applications, consider a CDN in front of your API calls
  5. Regional Endpoints: Use the endpoint closest to your application (if multiple regions are supported)

Security Considerations

  1. API Key Management: Rotate keys regularly and use the principle of least privilege
  2. Input Sanitization: Validate and sanitize all inputs before sending to the API
  3. TLS/HTTPS: Always use HTTPS (the API will reject HTTP requests)
  4. Response Handling: Don’t expose full API responses to end users
  5. Rate Limiting: Implement your own rate limiting to avoid service disruption