OpenAIcostAPI

by Robin Schregle & Tim Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Artificial Intelligence
Introduced first in SolidGeometry 5.5, Creation date: 2024-11-04, Last change: 2025-08-19

opens the web page of company openAI to show the users expenses

Description

1) Download from Gitgub (see link below) the Large Language Model (LMM) functions of Matlab and store the files in a folder in your Matlab code directory using the
folder name [pwd filesep 'llms-with-matlab']
2) add this path to your main directory using
addpath([pwd filesep 'llms-with-matlab'])
3) create an API account at openAI
you have to start an account store your credit card info (see link below)
4) create an environment ascii file with name "OPENAI_API_KEY.env" that contains a single line
OPENAI_API_KEY=""
5) load this environmentfile by
loadenv("OPENAI_API_KEY.env")
6) set the model to
modelName = "gpt-4o";


See Also: jarvisChatSGLib , json2matlab , jsonplansequence , OpenAIrequest

Example Illustration

 missing image of OpenAIcostAPI

Syntax

OpenAIcostAPI

Examples


OpenAIcostAPI

Additional Hyperlinks

,



Copyright 2024-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, OpenAIcostAPI, is designed to open specific web pages related to OpenAI's platform to show the user's expenses and limits. It is part of the SolidGeometry library and was introduced in version 6.0.

Input Parameters

The function does not take any input parameters.

Output

The function returns an empty array cost=[], indicating that it does not compute or return any cost-related data directly.

Steps

  1. The function uses the web command to open two URLs in the default web browser:
    • web('https://platform.openai.com/settings/organization/usage'): This URL directs the user to the OpenAI platform's usage page, where they can view their API usage statistics.
    • web('https://platform.openai.com/settings/organization/limits'): This URL directs the user to the OpenAI platform's limits page, where they can view their API usage limits.
  2. The function concludes by returning an empty array cost=[].

Assumptions

The function assumes that the user has an active internet connection and access to the OpenAI platform. It also assumes that the user has already set up an OpenAI API account and has the necessary credentials to access the usage and limits pages.

Additional Information

The function is part of a larger library related to artificial intelligence and is intended to be used in conjunction with other functions that interact with OpenAI's API. The function does not perform any calculations or data processing; it simply provides quick access to relevant OpenAI account information.

Algorithm explaination created using ChatGPT on 2025-08-19 08:04. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21