API Credential Issues
Troubleshooting problems with third-party API keys and credentials used by UniSync.
Invalid API Key
Symptoms: API calls fail with 401 Unauthorized or Invalid API Key errors. Content generation or keyword research does not work.
Cause: The API key is incorrect, belongs to the wrong provider, or has been revoked.
Resolution:
- Go to API Management in UniSync and check which keys are configured.
- Verify you are using the right key for the right provider:
- Text generation: OpenAI API key (starts with
sk-) or compatible provider key. - Search/Keywords: Google Ads API credentials.
- Image generation: Provider-specific key (DALL-E uses the OpenAI key; others have separate keys).
- Text generation: OpenAI API key (starts with
- Test the key outside UniSync:bash
# OpenAI curl https://api.openai.com/v1/models \ -H "Authorization: Bearer sk-your-key-here" # A valid key returns a JSON list of models. # An invalid key returns a 401 error. - If the key was recently rotated or regenerated, update it in UniSync -- old keys stop working immediately.
- Check for invisible characters: copy the key from the provider dashboard fresh rather than from a text file that may have added whitespace or line breaks.
Rate Limit Exceeded
Symptoms: Requests fail with 429 Too Many Requests. Content generation works sometimes but fails under load. Logs show "rate limit" messages.
Cause: You are sending more requests per minute than the API provider allows for your plan tier.
Resolution:
- UniSync handles rate limits automatically with exponential backoff and retry. In most cases, the operation will succeed after a short delay.
- If rate limits are persistent:
- Check your usage on the provider dashboard.
- Consider upgrading your API plan for higher rate limits.
- Reduce the number of agents running simultaneously.
- Increase the interval between agent runs.
- Provider rate limit dashboards:
- OpenAI: platform.openai.com/usage
- Google Ads: Google Ads API rate limits documentation
- If running many agents in parallel, stagger their start times to avoid bursts.
Quota Exhausted
Symptoms: API calls fail with messages about exceeded quota or insufficient funds. Everything was working earlier in the month.
Cause: You have hit the monthly spending limit or prepaid credit balance on your API account.
Resolution:
- Check your billing status:
- OpenAI: platform.openai.com/account/billing
- Google Cloud: console.cloud.google.com/billing
- Add funds or increase limits:
- OpenAI: Add a payment method or increase your monthly limit in billing settings.
- Google Ads: Check your developer account budget.
- Review spending with Token Analytics: UniSync tracks token usage per agent and per environment. Use the Token Analytics dashboard to see which agents are consuming the most tokens.
- Prevent future exhaustion:
- Set up billing alerts on the provider's dashboard.
- Use UniSync's monthly budget settings in Token Analytics to cap spending.
- Use smaller/cheaper models for classification and keyword tasks (see Token Limits).
Provider Service Outage
Symptoms: All API calls fail simultaneously. Other UniSync features (UI, database) work fine. The provider's status page shows an incident.
Cause: The API provider is experiencing downtime or degraded performance.
Resolution:
- Check provider status pages:
- OpenAI: status.openai.com
- Google Cloud: status.cloud.google.com
- Anthropic: status.anthropic.com
- Wait and retry. Provider outages are typically resolved within minutes to hours.
- UniSync will automatically retry failed requests. Agents that fail during an outage can be re-run once service is restored.
- If the outage is prolonged, consider:
- Pausing autopilot agents to avoid accumulating failed runs.
- Checking social media or developer forums for outage reports if the status page has not been updated.
Google Ads API: Developer Token and OAuth
Symptoms: Keyword research or search volume features fail. Errors mention "developer token", "OAuth", or "Google Ads API access".
Cause: Google Ads API requires a multi-step setup: a developer token, OAuth 2.0 credentials, and a linked Google Ads account.
Resolution:
- Developer token: Required for all Google Ads API access.
- Log in to your Google Ads account.
- Go to Tools & Settings > API Center.
- Apply for a developer token if you do not have one.
- Note: New tokens start with "Test account" access (limited). Apply for "Basic" access for production use.
- OAuth 2.0 credentials:
- Create credentials in Google Cloud Console.
- Enable the "Google Ads API" in your Google Cloud project.
- Generate an OAuth 2.0 Client ID (type: Web application or Desktop).
- Complete the OAuth consent screen setup.
- Refresh token: After OAuth setup, you need a refresh token:
- Use the OAuth flow to authorize your Google Ads account.
- Store the refresh token in UniSync's API Management.
- Link accounts: The Google Cloud project must be linked to the Google Ads account that owns the developer token.
- Test access:
- Google Ads API Explorer: developers.google.com/google-ads/api/tools/google-ads-api-explorer
- Verify your developer token status in Google Ads > Tools & Settings > API Center.
Credential Storage
Best practices for managing API credentials in UniSync:
- All credentials are stored in the PostgreSQL database, associated with your user account.
- Credentials are never exposed in API responses after initial creation (masked display).
- Each publish environment can have its own set of credentials.
- When rotating keys, update the credential in UniSync immediately after generating the new key on the provider side.
- If you suspect a key has been compromised, revoke it on the provider's dashboard first, then update UniSync.