Unexpected Usage and more blocked requests from OpenAI service

Vishnuram Jatin 20 Reputation points
2025-04-11T17:41:55.8266667+00:00

Hello,

Recently I have suddenly been charged almost 1000 dollars from March and it is due to high input token usage of OpenAI. However my usage and the project does not consume any tokens and it is astonishing to see that from March my token usage has been surged up and also blocked requests in the metrics show that many questions are sexual and harmful. It means that my token is being misused to someone I have not received any alerts or information regarding this matter. I want to know how to resolve this issue.

As you can see from the screenshots, my usage is expected to be as the usage of February but definitely not March and April.Please guide me on how to proceed this privacy and security issue.march_blocked_request

february_blocked_request

march_token_usage

feb_token_usage

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,602 questions
{count} votes

Accepted answer
  1. Prashanth Veeragoni 4,930 Reputation points Microsoft External Staff Moderator
    2025-04-14T19:35:25.1466667+00:00

    Hi Vishnuram Jatin,

    Thank you for confirming that regenerating the key resolved the issue. Regarding your concern about how the key might have been compromised — even if it wasn’t exposed publicly — here are several possible vectors for leakage to consider:

    1.Accidental Exposure via Logs or Debug Output

    Even though the key wasn't in a public repo or client-side code, it might have been:

    ·       Printed in server logs or stack traces

    ·       Logged during exception handling or debugging

    ·       Captured in monitoring tools like Application Insights, Sentry, etc.

    Recommendation: Double-check your logs, especially in development and staging environments.

    2.Local Machine or Dev Environment Vulnerability

    If your system was compromised (via malware or a browser extension), keys stored in local .env files or config files could have been read.

    Recommendation: Use a password manager or Azure Key Vault, and avoid storing secrets locally.

    3.Shared Collaborators or CI/CD Pipelines

    If anyone else had access to:

    ·       Your codebase

    ·       CI/CD pipelines (GitHub Actions, Azure DevOps, etc.)

    ·       DevOps secrets or environment variables

    They might have had visibility into the key.

    Recommendation: Rotate keys regularly and audit access controls.

    4.Insecure Hosting or Public API Endpoints

    If the key was used on a public or test endpoint (even temporarily), it could have been captured by bots scanning exposed APIs.

    Recommendation: Use Azure API Management or rate-limiting gateways, and restrict usage by IP address or network firewall rules.

    5.Third-party Libraries or Integrations

    If you used any third-party SDKs, libraries, or plugins that accept your key as input, they may have inadvertently leaked it (e.g., in telemetry).

    Recommendation: Review dependencies and avoid giving sensitive keys to any untrusted service.

    Hope this helps. Do let me know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let me know.

    Thank you! 


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.