Skip to content

Proof of Concept code playing around with the OpenAI / GPT / ChatGPT API

License

Notifications You must be signed in to change notification settings

0xdevalias/poc-chatgpt

Repository files navigation

poc-chatgpt

Run this script (Source):

# https://platform.openai.com/account/api-keys
export OPENAI_API_KEY=TODO-YOUR-API-KEY-HERE

node index.js

List available models (Ref):

# https://platform.openai.com/account/api-keys
export OPENAI_API_KEY=TODO-YOUR-API-KEY-HERE

# Fetch all the model data
curl https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY" > models.json

# Extract just the model names from the model data
jq -r '.data[].id' models.json > models.txt

# Or you could just run this helper script:
# npm run-script update-models

# You may also like to run:
# npm run-script extract-models-by-owned-by

Get details for a single model (Ref):

# https://platform.openai.com/account/api-keys
export OPENAI_API_KEY=TODO-YOUR-API-KEY-HERE

# Fetch a specific model's data
curl https://api.openai.com/v1/models/TODO-MODEL-ID-HERE -H "Authorization: Bearer $OPENAI_API_KEY" > models.json

List available engines (deprecated) (Ref):

# https://platform.openai.com/account/api-keys
export OPENAI_API_KEY=TODO-YOUR-API-KEY-HERE

# Fetch all the engine data
curl https://api.openai.com/v1/engines -H "Authorization: Bearer $OPENAI_API_KEY" > engines.json

# Extract just the engine IDs from the engine data
jq -r '.data[].id' engines.json > engines.txt

# Or you could just run this helper script:
# npm run-script update-engines

Get details for a single engine (deprecated) (Ref):

# https://platform.openai.com/account/api-keys
export OPENAI_API_KEY=TODO-YOUR-API-KEY-HERE

# Fetch a specific engine's data
curl https://api.openai.com/v1/engines/TODO-ENGINE-ID-HERE -H "Authorization: Bearer $OPENAI_API_KEY"

Leaked Model Controversy

You can read more about my running notes/research around the leaked model, how it was taken down, and the supposed existence of a new model (though that situation seems super scammy) here:

The following leaked model names have been found, and may or may not still be working:

  • text-chat-davinci-002-20230126
  • text-chat-davinci-002-20221122

See Also