Skip to content

Commit 9048d6c

Browse files
committed
docs: add Z.AI API key setup instructions
1 parent a055410 commit 9048d6c

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,27 @@ Options:
8989

9090
`paperdown` reads `ZAI_API_KEY` from environment first. If not found, it reads the value from `--env-file`.
9191

92+
### Get a key
93+
94+
Create an account in the Z.AI console, then generate an API key from your account settings. In most dashboards this is under Settings, then API keys. Create a new key and copy it once, as you will not be able to view it again.
95+
96+
### Store it
97+
98+
The simplest option is to set `ZAI_API_KEY` in your shell environment.
99+
100+
```bash
101+
export ZAI_API_KEY="your-api-key"
102+
paperdown --input path/to/paper.pdf
103+
```
104+
105+
If you prefer a file, create a `.env` file (this repository ignores `.env` via `.gitignore`).
106+
107+
```dotenv
108+
ZAI_API_KEY=your-api-key
109+
```
110+
111+
Then run `paperdown` normally, or point to a different file with `--env-file`.
112+
92113
## Cost
93114

94115
The tool records token usage in `log.jsonl` under the `usage` field. With pricing at `$0.03` per `1,000,000` tokens, the average size scientific paper ([Batista et al., 2022](https://hess.copernicus.org/articles/26/3753/2022/)) process with `total_tokens = 79,080` costs `$0.0023724`. That is roughly `0.24` cents per article.

0 commit comments

Comments
 (0)