404 Error When Initializing Claude API with Valid API Key #480

Closed
opened 2026-02-16 10:19:31 -05:00 by yindo · 6 comments
Owner

Originally created by @RuthlessXdream on GitHub (Jul 24, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

Version 1.7.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Set up the Claude API using a valid API key (confirmed working with other endpoints).
  2. The error occurs immediately, even before making any specific model request.

Error message:

Error code: 404
{
  "type": "error",
  "error": {
    "type": "not_found_error",
    "message": "model: claude-3-opus-20240229"
  }
}

This seems to happen during API initialization or when the client attempts to auto-load the default model.

Image

✔️ Expected Behavior

The API should work normally after setting a valid API key.

Actual Behavior

Even with the correct API key, I got a 404 error:
model: claude-3-opus-20240229 not found

Originally created by @RuthlessXdream on GitHub (Jul 24, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version Version 1.7.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Set up the Claude API using a valid API key (confirmed working with other endpoints). 2. The error occurs immediately, even before making any specific model request. **Error message:** ``` Error code: 404 { "type": "error", "error": { "type": "not_found_error", "message": "model: claude-3-opus-20240229" } } ``` This seems to happen during API initialization or when the client attempts to auto-load the default model. <img width="418" height="138" alt="Image" src="https://github.com/user-attachments/assets/223587a9-0d77-4569-96de-df614a121df1" /> ### ✔️ Expected Behavior The API should work normally after setting a valid API key. ### ❌ Actual Behavior Even with the correct API key, I got a 404 error: `model: claude-3-opus-20240229 not found`
yindo added the good first issue label 2026-02-16 10:19:31 -05:00
yindo closed this issue 2026-02-16 10:19:31 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 24, 2025):

Hi @RuthlessXdream! I'm Dosu and I’m helping the dify team.

Dify v1.7.0 does not support the model claude-3-opus-20240229 by default because it lacks the required configuration for this model. To add support, you need to create a YAML file named after the model (e.g., claude-3-opus-20240229.yaml) in the appropriate module, specifying the model identifier, type, features, properties, parameter rules, and pricing. Dify only recognizes models that are explicitly defined this way—there is no dynamic fetching or automatic whitelisting for new Claude models, so attempts to use an undefined model will result in a 404 error like the one you’re seeing. You can find details and examples for adding new models in the provider/model integration documentation and predefined model integration guide.

After adding the YAML file, restart your Docker containers to ensure the new model is loaded. If you want to rule out Anthropic-side issues, you can test the model directly with their API using curl or Postman.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Jul 24, 2025): <!-- Greeting --> Hi @RuthlessXdream! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> Dify v1.7.0 does not support the model claude-3-opus-20240229 by default because it lacks the required configuration for this model. To add support, you need to create a YAML file named after the model (e.g., claude-3-opus-20240229.yaml) in the appropriate module, specifying the model identifier, type, features, properties, parameter rules, and pricing. Dify only recognizes models that are explicitly defined this way—there is no dynamic fetching or automatic whitelisting for new Claude models, so attempts to use an undefined model will result in a 404 error like the one you’re seeing. You can find details and examples for adding new models in the [provider/model integration documentation](https://github.com/langgenius/dify/blob/bd43ca6275f8553ce623556936ad84e7f865a656/api/core/model_runtime/docs/en_US/provider_scale_out.md) and [predefined model integration guide](https://github.com/langgenius/dify/blob/bd43ca6275f8553ce623556936ad84e7f865a656/api/core/model_runtime/docs/en_US/predefined_model_scale_out.md). After adding the YAML file, restart your Docker containers to ensure the new model is loaded. If you want to rule out Anthropic-side issues, you can test the model directly with their API using curl or Postman. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/e20ca8ff-19b3-4851-824f-9085391c83d9?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/e20ca8ff-19b3-4851-824f-9085391c83d9?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/e20ca8ff-19b3-4851-824f-9085391c83d9?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/e20ca8ff-19b3-4851-824f-9085391c83d9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e20ca8ff-19b3-4851-824f-9085391c83d9?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/e20ca8ff-19b3-4851-824f-9085391c83d9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e20ca8ff-19b3-4851-824f-9085391c83d9?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/22918)
Author
Owner

@RuthlessXdream commented on GitHub (Jul 24, 2025):

Hi @RuthlessXdream! I'm Dosu and I’m helping the dify team.

Dify v1.7.0 does not support the model claude-3-opus-20240229 by default because it lacks the required configuration for this model. To add support, you need to create a YAML file named after the model (e.g., claude-3-opus-20240229.yaml) in the appropriate module, specifying the model identifier, type, features, properties, parameter rules, and pricing. Dify only recognizes models that are explicitly defined this way—there is no dynamic fetching or automatic whitelisting for new Claude models, so attempts to use an undefined model will result in a 404 error like the one you’re seeing. You can find details and examples for adding new models in the provider/model integration documentation and predefined model integration guide.

After adding the YAML file, restart your Docker containers to ensure the new model is loaded. If you want to rule out Anthropic-side issues, you can test the model directly with their API using curl or Postman.

To reply, just mention @dosu.

How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

Hi @dosu, thanks for the detailed explanation!

Just to clarify — I encountered this 404 error right after binding the API key, before even getting to the workflow or trying to use the model in any actual requests. It seems like the system is trying to validate or load the model at the API key setup stage.

Will this behavior be addressed or improved in the next version of Dify?
It would be great if unsupported models didn’t trigger errors so early, especially when they haven't yet been used in a workflow.

Thanks again for your help!

@RuthlessXdream commented on GitHub (Jul 24, 2025): > Hi [@RuthlessXdream](https://github.com/RuthlessXdream)! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. > > Dify v1.7.0 does not support the model claude-3-opus-20240229 by default because it lacks the required configuration for this model. To add support, you need to create a YAML file named after the model (e.g., claude-3-opus-20240229.yaml) in the appropriate module, specifying the model identifier, type, features, properties, parameter rules, and pricing. Dify only recognizes models that are explicitly defined this way—there is no dynamic fetching or automatic whitelisting for new Claude models, so attempts to use an undefined model will result in a 404 error like the one you’re seeing. You can find details and examples for adding new models in the [provider/model integration documentation](https://github.com/langgenius/dify/blob/bd43ca6275f8553ce623556936ad84e7f865a656/api/core/model_runtime/docs/en_US/provider_scale_out.md) and [predefined model integration guide](https://github.com/langgenius/dify/blob/bd43ca6275f8553ce623556936ad84e7f865a656/api/core/model_runtime/docs/en_US/predefined_model_scale_out.md). > > After adding the YAML file, restart your Docker containers to ensure the new model is loaded. If you want to rule out Anthropic-side issues, you can test the model directly with their API using curl or Postman. > > _To reply, just mention [@dosu](https://go.dosu.dev/dosubot)._ > > How did I do? [Good](https://app.dosu.dev/response-feedback/e20ca8ff-19b3-4851-824f-9085391c83d9?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/e20ca8ff-19b3-4851-824f-9085391c83d9?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/e20ca8ff-19b3-4851-824f-9085391c83d9?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/e20ca8ff-19b3-4851-824f-9085391c83d9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e20ca8ff-19b3-4851-824f-9085391c83d9?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/e20ca8ff-19b3-4851-824f-9085391c83d9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e20ca8ff-19b3-4851-824f-9085391c83d9?feedback_type=other)  [![Chat with Dosu](https://camo.githubusercontent.com/d9ffebb979729c9ef0fc4e3090dbae5b17cabbfec8afe378ada6b81913d6ad8a/68747470733a2f2f646f73752e6465762f646f73752d636861742d62616467652e737667)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github) [![Join Discord](https://camo.githubusercontent.com/d562c2df5e4567ea41d37f1d91a4da0839d8341037045b103b2da268998de17f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a6f696e2d3538363546323f6c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465266c6162656c3d)](https://go.dosu.dev/discord-bot) [![Share on X](https://camo.githubusercontent.com/4649f705e2396d6f328dbc8e800a0509c9c17b3b20253b36706c393df124b93d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f582d73686172652d626c61636b)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/22918) Hi @dosu, thanks for the detailed explanation! Just to clarify — I encountered this 404 error **right after binding the API key**, before even getting to the workflow or trying to use the model in any actual requests. It seems like the system is trying to validate or load the model at the API key setup stage. Will this behavior be addressed or improved in the next version of Dify? It would be great if unsupported models didn’t trigger errors so early, especially when they haven't yet been used in a workflow. Thanks again for your help!
Author
Owner

@dosubot[bot] commented on GitHub (Jul 24, 2025):

Dify currently validates models at API key binding time, not deferred until first use—this is intentional and matches the current design. There are no explicit plans or ongoing work in the codebase or roadmap to change this behavior or defer model validation to a later stage. Recent updates around model/provider validation (like Model Provider Validation and parameter filtering) focus on improving robustness and user feedback, but do not address the timing of model validation or error handling at API key setup. If you'd like to see deferred/lazy model validation, proposing it as a feature request would be the best way to get it on the team's radar.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Jul 24, 2025): <!-- Answer --> Dify currently validates models at API key binding time, not deferred until first use—this is intentional and matches the current design. There are no explicit plans or ongoing work in the codebase or roadmap to change this behavior or defer model validation to a later stage. Recent updates around model/provider validation (like [Model Provider Validation](https://github.com/langgenius/dify/pull/21808) and parameter filtering) focus on improving robustness and user feedback, but do not address the timing of model validation or error handling at API key setup. If you'd like to see deferred/lazy model validation, proposing it as a feature request would be the best way to get it on the team's radar. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/8159f16c-1e41-4ccd-b52b-821fadbf4ccf?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/8159f16c-1e41-4ccd-b52b-821fadbf4ccf?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/8159f16c-1e41-4ccd-b52b-821fadbf4ccf?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/8159f16c-1e41-4ccd-b52b-821fadbf4ccf?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8159f16c-1e41-4ccd-b52b-821fadbf4ccf?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/8159f16c-1e41-4ccd-b52b-821fadbf4ccf?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8159f16c-1e41-4ccd-b52b-821fadbf4ccf?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/22918)
Author
Owner
@crazywoola commented on GitHub (Jul 24, 2025): I think this should be changed somehow. https://github.com/langgenius/dify-official-plugins/blob/0c3a5875866f2746f9ae873a19adc609abc61c13/models/anthropic/provider/anthropic.py#L19-L20
Author
Owner

@dosubot[bot] commented on GitHub (Aug 21, 2025):

Hi, @RuthlessXdream. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a 404 error on Dify v1.7.0 when initializing the Claude API with a valid key due to the model "claude-3-opus-20240229" not being preconfigured.
  • The current design requires explicit YAML configuration for new models, and model validation happens at API key binding time.
  • There are no current plans to defer this validation, which causes early errors for unsupported models.
  • You suggested that unsupported models should not error so early, and another user agreed with this behavior change.
  • The issue remains unresolved with no implemented changes yet.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of dify-official-plugins by commenting here to keep the discussion open.
  • Otherwise, I will automatically close this issue in 5 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 21, 2025): Hi, @RuthlessXdream. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a 404 error on Dify v1.7.0 when initializing the Claude API with a valid key due to the model "claude-3-opus-20240229" not being preconfigured. - The current design requires explicit YAML configuration for new models, and model validation happens at API key binding time. - There are no current plans to defer this validation, which causes early errors for unsupported models. - You suggested that unsupported models should not error so early, and another user agreed with this behavior change. - The issue remains unresolved with no implemented changes yet. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of dify-official-plugins by commenting here to keep the discussion open. - Otherwise, I will automatically close this issue in 5 days. Thank you for your understanding and contribution!
Author
Owner

@hirokisasayama commented on GitHub (Nov 14, 2025):

If the same issue occurs with the cloud version, what is the cause and how should I deal with it?

@hirokisasayama commented on GitHub (Nov 14, 2025): If the same issue occurs with the cloud version, what is the cause and how should I deal with it?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#480