It looks like you're getting a Bad Request (400) error due to an "Invalid API key" message from the system youβre testing with. Here are the most common reasons and step-by-step solutions:
1. Double-check Your API Key
- Ensure you generated your Pawan.Krd API key in our Discord serverβs #π€ππ¨π channel by running
/key. - Copy the key exactly as shownβno extra spaces before or after.
- Do NOT share your API key.
2. Confirm Your Endpoint
- Make sure the endpoint matches the model you want to use; for example:
Donβt use backticks, emojis, or extra characters!https://api.pawan.krd/cosmosrp/v1/chat/completions
3. Set Your Authorization Header Correctly
- Use this header in your JS code:
ReplaceAuthorization: Bearer YOUR_API_KEYYOUR_API_KEYwith your actual key.
4. Ensure JSON Payload is Valid
- You must structure your request correctly. Example:
Adjust{ "model": "cosmosrp", "messages": [{"role": "user", "content": "Hello"}] }"model"field to match the endpoint you're using.
5. Common Mistakes to Avoid
- API key is not valid (expired, revoked, mistyped, or not yet claimed).
- Incorrect endpoint.
- Request payload in the wrong shape.
- API key used on a different IP than originally locked to.
6. Check Your Credits
- If you havenβt used
/claimin our Discord server, you must do that in #π€ππ¨π to activate your daily credits.