Skip to main content

Introduction

AiPrice allows you to easily calcualte how many tokens are in your prompt and to calculate the cost of the prompt before making an OpenAI API request. All pricing is done in USD. You can use any preffered HTTP client you would like to make the requests.

Getting Started

AiPrice offers a free version, just enter your email at our homepage and you will recieve 50 free credits. Each credit is one request. If you would like to use more credits, feel free to purchase from our homepage under "pricing".

API Authentication

Regardless of what plan you are subscribed to, you be required to include X-API-KEY in your request headers. For example:

curl -H "X-API-KEY: cb1947c3402b4f26a177a0c3e3812a2b" https://api.aiprice.dev/usage 

Responses

All responses will be returned as following:

{"price": float, "token_count": int}

Supported OpenAI Models

The following are the supported OpenAI Models:

GPT4:

  • gpt-4
  • gpt-4-0314
  • gpt-4-32k
  • gpt-4-32k-0314

GPT3.5:

  • gpt-3.5-turbo
  • gpt-3.5-turbo-0301
  • text-davinci-003
  • text-davinci-002
  • code-davinci-002

GPT3:

  • text-curie-001
  • text-babbage-001
  • text-ada-001
  • davinci
  • curie
  • babbage
  • ada

Codex:

  • code-davinci-002
  • code-davinci-001
  • code-cushman-002
  • code-cushman-001