💧
OLI API
  • Welcome to the OLI API documentation
  • Basic workflow
  • Authentication
    • Bearer Token
    • API Keys
      • Generate a Key
      • List All Keys
      • Delete a Key
  • Generating chemistry model files
    • ChemBuilder API
      • Getting Started with ChemBuilder
        • Set Thermodynamic Framework
        • Include Private Databanks
        • Include Inflows
          • Include Assays
          • Include Pseudocomponent
        • Choose Phases
        • Specify Model Name
        • Choose Redox
        • Choose Solids
        • Add Kinetics
      • ChemBuilder Query
        • Species Query
        • Redox Query
        • Solid Phase Query
        • Databank Query
        • Kinetics Query
        • Query Output Results
      • Supporting Information for ChemBuilder
        • Add Comment
        • "enabled" Keyword
        • ChemBuilder Errors
    • Chemistry Wizard
  • Uploading chemistry model files
  • Get list of uploaded files
  • Quickstart example: Python
  • Known issues and Limitations
  • OLI ENGINE API
    • Main methods
      • API call blueprint
      • Chemistry information
      • Isothermal flash
      • Isenthalpic flash
      • Bubble point flash
      • Dew point flash
      • Vapor amount flash
      • Vapor fraction flash
      • Isochoric flash
      • set pH flash
      • Precipitation point flash
      • Autoclave
      • Custom flash
      • Corrosion contact surfaces
      • Corrosion rates
      • Water analysis
  • Additional methods
    • Flash history - Chemistry model
    • Result - by jobId
    • delete file
    • cancel run
  • Inflows input
  • Optional inputs
  • Kinetic calculation inputs
  • Kinetic calculation outputs
  • Input units
  • User defined output unit set
  • Survey calculation
  • Stream output
  • Error/Warning output
  • Definition of terms
  • OLI Process API
    • Uploading a Process API package
      • Creating a Process API package
    • Get list of all uploaded ProcessAPI packages
    • Get input specs for Process API package
    • Get output specs for ProcessAPI package
    • Run a Process API calculation
    • Get calculation status and results
  • Deleting a process package
  • Undelete a process package
  • Process API input specification
    • "data" object
      • "flowsheet" object
        • "chemical-info" object
        • "general-info" object
        • "properties" object
        • "units_set_info" object
  • OLI ScaleChem API
    • Uploading chemistry model files for ScaleChem API
    • Get list of uploaded ScaleChem model files
    • Main methods
      • Brine analysis
      • Gas analysis
      • Oil analysis
      • Mixer calculation
      • Scale scenario
Powered by GitBook
On this page
  • Bearer Tokens
  • API Keys
  • Why Use API Keys for Automation?
  • Best Practices for Using API Keys
  • When to Use Which?
  • Bearer Tokens

Was this helpful?

Authentication

The OLI API supports two authentication methods: Bearer Tokens and API Keys. Each serves distinct purposes and is suited for different use cases. This summary provides an overview of both methods, highlighting their advantages and best practices.

Bearer Tokens

Overview

Bearer tokens are short-lived credentials obtained through authentication using a username and password. They are required to access API endpoints and are used to generate API keys.

Key Characteristics

  • Authentication Flow: Requires a username, password, and client credentials to obtain the token.

  • Time-Limited: Typically valid for 24 hours.

  • Usage: Ideal for manual or interactive sessions where a user logs in to perform actions.

  • Rate-Limited: The token generation process is subject to rate limits, ensuring fair usage and preventing abuse.


API Keys

Overview

API keys are long-lived credentials generated by authenticated users. They are designed for automated scenarios, such as scheduled tasks or system-to-system communication.

Key Characteristics

  • Generated Using Bearer Tokens: API keys are created via a dedicated endpoint after bearer token authentication.

  • Time-Limited: Can have custom expiration dates to control their validity period.

  • Flexible: Can be named for easy identification and managed (listed or deleted) through the API.

  • Usage: Ideal for automated processes to reduce the need for frequent authentication.


Why Use API Keys for Automation?

  • Reduced Transaction Overhead:

    • Eliminates the need to repeatedly authenticate via bearer token, reducing login-related delays.

  • Rate Limitation Avoidance:

    • Avoids frequent login attempts that are subject to rate limits, making it more suitable for high-frequency operations.

  • Custom Expiry:

    • API keys can be configured with specific expiration dates to control access duration.

  • Scalability:

    • Simplifies integration with applications that need persistent, secure access to the API.


Best Practices for Using API Keys

  1. Set Expiry Dates:

    • Use a reasonable expiration period to limit the exposure of compromised keys.

  2. Limit Active Keys:

    • Each user can have up to 5 active keys. Regularly review and delete unused keys.

  3. Secure Storage:

    • Store API keys securely. They are displayed only once during generation.

  4. Rotate Keys Periodically:

    • Regularly replace keys to maintain security and minimize risk.


When to Use Which?

  • Bearer Tokens:

    • Best for interactive sessions or when initial authentication is required (e.g., generating API keys).

  • API Keys:

    • Best for automated systems or when long-term access without frequent authentication is required.

By combining bearer tokens for initial authentication and API keys for ongoing automated operations, you can optimize security and performance while adhering to best practices.


Bearer Tokens

PreviousBasic workflowNextBearer Token

Last updated 6 months ago

Was this helpful?