https://github.com/adamelliotfields/api-scripts
A collection of Bash scripts for interacting with various API providers
https://github.com/adamelliotfields/api-scripts
bash curl
Last synced: 3 months ago
JSON representation
A collection of Bash scripts for interacting with various API providers
- Host: GitHub
- URL: https://github.com/adamelliotfields/api-scripts
- Owner: adamelliotfields
- License: mit
- Created: 2025-03-08T19:55:34.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-03-18T13:28:32.000Z (3 months ago)
- Last Synced: 2025-03-18T14:31:53.759Z (3 months ago)
- Topics: bash, curl
- Language: Shell
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# api-scripts
A collection of Bash scripts for interacting with various API providers.
## Installation
You need some popular Rust/Go/C programs:
```sh
apt install bat fd-find fzf jq# or
brew install bat fd fzf jq
```## Setup
Ensure each provider has the appropriate environment variable set:
```sh
export HF_TOKEN=hf_...
export OPENAI_API_KEY=sk-...
export ANTHROPIC_API_KEY=sk-...
export STABILITY_API_KEY=sk-...
```## Usage
Each script is self-contained and executable with `getopts` for portability. All use `-h` for help, for example:
```
$ ./openai/chat.sh -hChat with a language model
https://platform.openai.com/docs/api-reference/chat/create
Usage: chat.sh [OPTIONS]
Arguments:
The text to send to the modelOptions:
-m Model to use [default: gpt-4o-mini]
-s System message to use [default: 'Be precise and concise.']
-t Maximum tokens to generate [default: 1024]
-d Dump headers to file
-u Unbuffered (streaming) output from the API
-h Print helpEnvironment Variables:
OPENAI_API_KEY Your OpenAI API key (required)
```## Motivation
1. Have a working reference for various API providers.
2. Write more Bash.