HKUST Generative AI API Service

Welcome to the Generative AI API Service, our centralized gateway designed to empower staff and students with seamless access to state-of-the-art Large Language Models (LLMs).

Our service provides a fully OpenAI-compatible API, allowing you to leverage a diverse and growing roster of industry-leading AI models using the tools, SDKs, and frameworks you already know.

Available To
Students, Staff
Service Fee

You will receive a free monthly credit of HKD 8.00, which will be automatically renewed on the first day of each month at 8:00am.  This credit is shared with your usage on the HKUST GenAI platform. For any additional usage, you may top up credits your own expense.

API Key Subscription

To access the Generative AI models, you will need an API key.  This key uniquely identifies each user.  Follow the instructions below to obtain your own API key.  REMEMBER to keep your API key secure and do not share it with others, as it provides access to your account and usage.

  • Navigate to the HKUST API Developer Portal on Microsoft Azure API Management
  • Sign up with your HKUST account

  • Navigate to the Products page from the top menu, and click on the HKUST GenAI
  • Enter a description for your reference, and click Subscribe
  • Click Show to display the hidden API keys.  Both primary and secondary keys can be used to access the Generative AI models

 

API Key Verification

Verify API key access to Generative AI API

Note: All API requests must include a custom header named api-key with your API key set as its value.

  • Method - Postman (GUI)
    • Launch Postman (Postman API Platform)
    • Prepare a POST request to https://hkust.azure-api.net/hkust-genai/v1/chat/completions, and set header and body as follows:
    • send the request to receive a response

 

Use OpenAI Python Library

Use the OpenAI Python library to integrate OpenAI's services into Python applications.

 

Rate Limits

Rate limits are restrictions that the API imposes on the number of times a user or client can access the services within a specified timeframe. Currently, the rate limit configured on the API gateway are set to 60 requests per minute.

Recommendations for staying within rate limits

  • Avoid sudden spikes in traffic and scale your workload gradually
  • Introduce deliberate delays between subsequent requests
  • Implement robust retry mechanisms (such as exponential backoff) in your application

 

Unsupported Features

 

Credit Balance & Top Up

To check your latest credit balance, you can retrieve both free and paid credits from:  https://hkust.azure-api.net/hkust-genai/v1/balance

Once you have depleted your credit, the following response will be returned when you try to access the OpenAI API.  Top up your credit at the OpenAI Credit Purchase System

Image
Thumbnail

 

Reference

AI Models Pricing


Learn More

The HKUST Generative AI API service is available to offices and departments on chargeback basis.  For further information, please contact cchelp@ust.hk.

Support

General Enquiries cchelp@ust.hk
Suggestions & Complaints cclisten@ust.hk
Serviceline +852-2358-6200