API Signup

The BastionGPT API offers developers access to powerful and HIPAA-compliant BastionGPT Generative AI services. In addition to improved compliance, BastionGPT API exceeds OpenAI ChatGPT (GPT-4) performance for our healthcare and therapy users as it has been expertly developed with those demands in mind. This document outlines the necessary details to integrate with the BastionGPT API, including input parameters, output structure, pricing, limitations, and an example of how to use the API. If you have additional questions about the API, or would like to apply for access, please schedule a time today via https://bastiongpt.com/meet.

API Inputs

Parameter
Type
Required?
Default
Description
Content-Type
string
Yes
application/json
Specifies the media type of the resource. This is typically application/json.
Key
string
Yes
n/a
A unique 32-digit alphanumeric API key provided to users for authentication.
Function
string
No
general
This parameter is used to specify specialty functions. As of the current version, only the "general" function is supported.
Temperature
number
No
0.5
A floating-point number between 0 and 1 indicates the level of creativity desired in the response. A lower value means less creativity but increased data accuracy.
Content
string
Yes
n/a
The actual content or prompt you wish to submit to BastionGPT.
Max Tokens
number
No
0.5
Maximum amount of data (expressed in tokens) that BastionGPT should generate in the response.

API Outputs

Parameter
Type
Default
Description
ID
string
A unique identifier for the generated response.
Created
number
A timestamp indicating when the prompt was created.
Content
string
The generated response to the submitted prompt.
Prompt_tokens
number
Number of tokens consumed by the prompt.
Completion_tokens
number
Number of tokens consumed by the response.
Total_tokens
number
Total number of tokens consumed by both the prompt and the response.
Finish_Reason
string
stop
Indicates the status of the prompt. Normal completion is indicated by stop. A content_filter status means the content was blocked due to detection of suspected unapproved use cases.

Pricing and Specifications


Monthly Access Charge
:
$100, which includes $20 of token credits each month.

Token Costs:
Input tokens: $0.018 per 1,000 tokens.
Output tokens: $0.045 per 1,000 tokens.

Specifications:
Tokens per minute: 30,000.
Requests per minute: 160.
Context limit: 7,850 tokens.
Cache size: 15MB.
Service Level Agreement (SLA): 99.9% uptime.

Available Regions:
Southern UK (additional $50/mo)
Eastern US
Western US
Australia

Streaming:
Currently, streaming of responses is not supported.

Allowed Use Cases:
Prior approval is required to ensure ethical and compliant use.

API URL & Example Usage

API Endpoint

https://api.bastiongpt.com/v1/ChatCompletion

HTTPS Request Example

POST /v1/ChatCompletion HTTP/1.1
Host: api.bastiongpt.com
Content-Type: application/json
Key: ab12345678901234567890123456

{
 "messages": [{"role": "user", "content": "What is a normal BP?"}],
 "max_tokens": 1000,
 "temperature": 0,
 "user": "C0001"
}

HTTPS Response Example

{
 "id": "s7RzpHeOFnpM",
 "created": 1709442176,
 "model": "bastiongpt",
 "choices": [
   {
     "finish_reason": "stop",
     "message": {
       "content": "A normal blood pressure (BP) for an adult is generally considered to be in the range of 90/60 mmHg to 120/80 mmHg..."
     }
   }
 ],
 "usage": {
   "prompt_tokens": 30,
   "completion_tokens": 383,
   "total_tokens": 413
 },
 "environment": "development"
}

API Subscription