Skip to main content

Prediction API client for Python

Project description


  • App will receive an HTTP POST call in this format
curl -X POST
    -H 'Authorization: Key API_KEY'
    -H "Content-Type: application/json"
    -d '
      "inputs": [
          "data": {
            "image": {
              "url": ""
  • Since this is a multi-tenant application and we cannot redploy it (or use the same key for multi customers), in order to turn on a new tenant, API keys need to be managed in Google Data Store. Project type in Datastore has a reference to valid API keys that can access it for prediction.

  • Import model_utilities from platform-ai package (TBD)

    model = get_model(project_id)
    model.predict_from_url(URL) returns prediction json

  • cache the model in memorystore for future requests, backend will invalidate this cache if/when the model is retrained

Error codes

  • Bad URL / not accessible
  • project_id invalid
  • rate limit exceeded
  • no trained model is available
  • backend error / something blew up

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for platformai, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size platformai-0.0.1.tar.gz (2.4 kB) File type Source Python version None Upload date Hashes View
Filename, size platformai-0.0.1-py3-none-any.whl (3.1 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page