Developer Documentation

gpt-4-0314 API Documentation

Complete API integration guide with Python, Node.js, and cURL examples. Integrate OpenAI models in 5 minutes.

Quick Start

1

Get API Key

Register for GetGoAPI and get your API Key from the dashboard.

2

Install SDK

GetGoAPI is compatible with OpenAI SDK. Use the official SDK directly.

Python

pip install openai

Node.js

npm install openai
3

Call API

Use OpenAI SDK with GetGoAPI by changing the base_url.

Code Examples

Python
from openai import OpenAI

# 配置 GetGoAPI
client = OpenAI(
    api_key="YOUR_GETGOAPI_KEY",  # 从 https://getgoapi.com 获取
    base_url="https://api.getgoapi.com/v1"
)

# 调用 gpt-4-0314
response = client.chat.completions.create(
    model="gpt-4-0314",
    messages=[
        {"role": "user", "content": "Hello, how are you?"}
    ]
)

print(response.choices[0].message.content)
Node.js
import OpenAI from 'openai';

// 配置 GetGoAPI
const client = new OpenAI({
  apiKey: 'YOUR_GETGOAPI_KEY',  // 从 https://getgoapi.com 获取
  baseURL: 'https://api.getgoapi.com/v1'
});

// 调用 gpt-4-0314
async function main() {
  const response = await client.chat.completions.create({
    model: 'gpt-4-0314',
    messages: [
      { role: 'user', content: 'Hello, how are you?' }
    ]
  });

  console.log(response.choices[0].message.content);
}

main();
cURL
curl https://api.getgoapi.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_GETGOAPI_KEY" \
  -d '{
    "model": "gpt-4-0314",
    "messages": [
      {
        "role": "user",
        "content": "Hello, how are you?"
      }
    ]
  }'

API Parameters

ParameterTypeDescription
modelstringModel name: gpt-4-0314
messagesarrayChat messages array
temperaturenumberSampling temperature (0-2), default 1
max_tokensnumberMaximum output tokens

Ready to Integrate?

Get your API Key and start using now

gpt-4-0314 API Documentation | Integration Guide | OpenAI